@@ -843,15 +843,18 @@ dnf_repo_loader_func(void)
843
843
DnfState * state ;
844
844
gboolean ret ;
845
845
g_autofree gchar * repos_dir = NULL ;
846
+ g_autofree gchar * vars_dir = NULL ;
846
847
g_autoptr (DnfContext ) ctx = NULL ;
847
848
g_autoptr (DnfRepoLoader ) repo_loader = NULL ;
848
849
guint metadata_expire ;
849
850
850
851
/* set up local context */
851
852
ctx = dnf_context_new ();
852
853
repos_dir = dnf_test_get_filename ("yum.repos.d" );
854
+ vars_dir = dnf_test_get_filename ("vars" );
853
855
dnf_context_set_repo_dir (ctx , repos_dir );
854
856
dnf_context_set_solv_dir (ctx , "/tmp" );
857
+ dnf_context_set_vars_dir (ctx , (const gchar * []){vars_dir , NULL });
855
858
ret = dnf_context_setup (ctx , NULL , & error );
856
859
g_assert_no_error (error );
857
860
g_assert (ret );
@@ -907,6 +910,13 @@ dnf_repo_loader_func(void)
907
910
g_assert_error (error , DNF_ERROR , DNF_ERROR_REPO_NOT_AVAILABLE );
908
911
g_assert (!ret );
909
912
g_clear_error (& error );
913
+
914
+ /* check that shell-style variable expressions are correctly expanded in repo values */
915
+ dnf_state_reset (state );
916
+ repo = dnf_repo_loader_get_repo_by_id (repo_loader , "shell-expansion" , & error );
917
+ g_assert_no_error (error );
918
+ g_assert (repo != NULL );
919
+ g_assert_cmpstr (dnf_repo_get_description (repo ), = = , "456" );
910
920
}
911
921
912
922
static void
0 commit comments