From 160b92daf385fbe627bd39ff4094316e2ecbf8f7 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 23 Mar 2023 14:54:14 -0500 Subject: software: don't ever call 'fedora-third-party disable' Instead, leave the setting unset if third-party repos are not disabled to give GNOME Software a chance to ask the user again. See: https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2118 https://pagure.io/fedora-workstation/issue/363 Fixes #186 --- .../pages/software/gis-software-page.c | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/gnome-initial-setup/pages/software/gis-software-page.c b/gnome-initial-setup/pages/software/gis-software-page.c index 16b00da..e1d0c28 100644 --- a/gnome-initial-setup/pages/software/gis-software-page.c +++ b/gnome-initial-setup/pages/software/gis-software-page.c @@ -81,25 +81,27 @@ gis_software_page_apply (GisPage *gis_page, g_autofree char *program = NULL; g_autoptr (GError) error = NULL; - program = find_fedora_third_party (); - - if (program) + if (priv->enabled) { - const char *arg1; - - if (priv->enabled) - arg1 = "enable"; - else - arg1 = "disable"; - - gis_pkexec (program, arg1, "root", &error); - if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_warning ("%s failed: %s", program, error->message); + program = find_fedora_third_party (); + if (program) + { + gis_pkexec (program, "enable", "root", &error); + if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("%s failed: %s", program, error->message); + } } + /* If not enabled, do nothing rather than calling 'fedora-third-party disable' + * to leave the setting in an indeterminate state, to allow GNOME Software to + * prompt the user once more when it runs for the first time. + */ + return FALSE; } +/* End distro-specific stuff */ + static void gis_software_page_locale_changed (GisPage *gis_page) { -- cgit v1.2.1