From 74730f904a0aee639b3eef38898216ce2a497998 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jun 20 2023 10:42:34 +0000 Subject: Workaround config-manager plugin missing from dnf5 using sed This is ugly, but ought to work, I hope. Signed-off-by: Adam Williamson --- diff --git a/lib/utils.pm b/lib/utils.pm index b0c91ba..f02d225 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -504,13 +504,12 @@ sub disable_updates_repos { both => 0, @_ ); - my $nonmod = "updates-testing"; - $nonmod .= " updates" if ($args{both}); - assert_script_run "dnf config-manager --set-disabled $nonmod"; + # FIXME as of 2023-06-20 dnf5 doesn't have config-manager plugin yet :( + assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates-testing.repo'; + assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates.repo' if ($args{both}); unless (script_run 'test -f /etc/yum.repos.d/fedora-updates-testing-modular.repo') { - my $mod = "updates-testing-modular"; - $mod .= " updates-modular" if ($args{both}); - assert_script_run "dnf config-manager --set-disabled $mod"; + assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates-testing-modular.repo'; + assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates-modular.repo' if ($args{both}); } } diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 120309f..14f30be 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -10,12 +10,13 @@ sub run { my $relnum = get_release_number; # use a tty console for repo config and package prep $self->root_console(tty => 3); - assert_script_run 'dnf config-manager --set-disabled updates-testing'; + disable_updates_repos; # for update tests, disable koji-rawhide at this point, otherwise # gnome-software will complain about things being unsigned even # though the repo has gpgcheck=0 if (get_var("ADVISORY_OR_TASK") && get_var("VERSION") eq get_var("RAWREL")) { - assert_script_run 'dnf config-manager --set-disabled koji-rawhide'; + # FIXME as of 2023-06-20 dnf5 doesn't have config-manager plugin yet :( + assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/koji-rawhide.repo'; } prepare_test_packages; # get back to the desktop