diff --git a/fedora-third-party-disable.patch b/fedora-third-party-disable.patch new file mode 100644 index 0000000..7efa0db --- /dev/null +++ b/fedora-third-party-disable.patch @@ -0,0 +1,64 @@ +From 160b92daf385fbe627bd39ff4094316e2ecbf8f7 Mon Sep 17 00:00:00 2001 +From: Michael Catanzaro +Date: Thu, 23 Mar 2023 14:54:14 -0500 +Subject: [PATCH] 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 16b00dad..e1d0c280 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) + { +-- +GitLab + diff --git a/gnome-initial-setup.spec b/gnome-initial-setup.spec index ae019b3..7f9f493 100644 --- a/gnome-initial-setup.spec +++ b/gnome-initial-setup.spec @@ -16,6 +16,9 @@ URL: https://wiki.gnome.org/Design/OS/InitialSetup Source0: https://download.gnome.org/sources/%{name}/44/%{name}-%{tarball_version}.tar.xz Source1: vendor.conf +# https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/merge_requests/197 +Patch0: fedora-third-party-disable.patch + BuildRequires: desktop-file-utils BuildRequires: gcc BuildRequires: meson