From fe804139e304b193ff512998d723487298a78ea1 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 10 Oct 2019 08:49:59 +0100 Subject: [PATCH 01/14] Backport a patch to correct the applications shown in the installed list --- ...-applications-in-the-installed-panel.patch | 129 ++++++++++++++++++ gnome-software.spec | 9 +- 2 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 0001-Do-not-show-non-applications-in-the-installed-panel.patch diff --git a/0001-Do-not-show-non-applications-in-the-installed-panel.patch b/0001-Do-not-show-non-applications-in-the-installed-panel.patch new file mode 100644 index 0000000..b208a03 --- /dev/null +++ b/0001-Do-not-show-non-applications-in-the-installed-panel.patch @@ -0,0 +1,129 @@ +From 575d6dddb5d46dbb7955f5d3e248054d6d1996b8 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Tue, 8 Oct 2019 17:07:09 +0100 +Subject: [PATCH] Do not show non-applications in the installed panel + +Using appstream-glib to parse the desktop files into fake AppStream components +had a drawback: it worked too well. What we wanted to do was only show +applications with AppData files in the installed list, only using the desktop +metadata if the icon could not be found in the AppStream metadata. + +Instead we showed all apps, even ones that would be disasterous if removed... + +Lets make this simpler; we can parse the desktop file directly. We only need +the icon and the component ID, so create a fake component without using +as_app_parse_data() at all. This should speed up initial startup, as we're +doing a lot less IO than before if there are a lot of desktop files installed. + +We'll also be storing less data (e.g. translations we're never going to use) in +the xmlb mmap store -- although it makes no difference to query speed it'll +make a difference for storage space. + +To ensure we only query AppData files for the installed list, we can now just +query for the existance of the tag -- which the fake components now will +not have. + +So that the xmlb store is regenerated with the fix, also add the package +version to the libxmlb cache guid. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1759193 +--- + plugins/core/gs-plugin-appstream.c | 62 +++++++++++++++++++++++++----- + 1 file changed, 53 insertions(+), 9 deletions(-) + +diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c +index 1f18693b..5f5ed05c 100644 +--- a/plugins/core/gs-plugin-appstream.c ++++ b/plugins/core/gs-plugin-appstream.c +@@ -206,20 +206,61 @@ gs_plugin_appstream_load_desktop_cb (XbBuilderSource *self, + GCancellable *cancellable, + GError **error) + { +- GString *xml; +- g_autoptr(AsApp) app = as_app_new (); ++ g_autofree gchar *icon = NULL; ++ g_autofree gchar *type = NULL; ++ g_autofree gchar *xml = NULL; + g_autoptr(GBytes) bytes = NULL; ++ g_autoptr(GKeyFile) kf = g_key_file_new (); ++ ++ /* get icon from desktop file */ + bytes = xb_builder_source_ctx_get_bytes (ctx, cancellable, error); + if (bytes == NULL) + return NULL; +- as_app_set_id (app, xb_builder_source_ctx_get_filename (ctx)); +- if (!as_app_parse_data (app, bytes, AS_APP_PARSE_FLAG_USE_FALLBACKS, error)) ++ if (!g_key_file_load_from_data (kf, ++ g_bytes_get_data (bytes, NULL), ++ g_bytes_get_size (bytes), ++ G_KEY_FILE_NONE, ++ error)) + return NULL; +- xml = as_app_to_xml (app, error); +- if (xml == NULL) ++ if (g_key_file_get_boolean (kf, ++ G_KEY_FILE_DESKTOP_GROUP, ++ G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, ++ NULL)) { ++ g_set_error_literal (error, ++ GS_PLUGIN_ERROR, ++ GS_PLUGIN_ERROR_NOT_SUPPORTED, ++ "NoDisplay=true"); + return NULL; +- g_string_prepend (xml, "\n"); +- return g_memory_input_stream_new_from_data (g_string_free (xml, FALSE), -1, g_free); ++ } ++ type = g_key_file_get_string (kf, ++ G_KEY_FILE_DESKTOP_GROUP, ++ G_KEY_FILE_DESKTOP_KEY_TYPE, ++ error); ++ if (type == NULL) ++ return NULL; ++ if (g_strcmp0 (type, G_KEY_FILE_DESKTOP_TYPE_APPLICATION) != 0) { ++ g_set_error (error, ++ GS_PLUGIN_ERROR, ++ GS_PLUGIN_ERROR_NOT_SUPPORTED, ++ "Type=%s", type); ++ return NULL; ++ } ++ icon = g_key_file_get_string (kf, ++ G_KEY_FILE_DESKTOP_GROUP, ++ G_KEY_FILE_DESKTOP_KEY_ICON, ++ error); ++ if (icon == NULL) ++ return NULL; ++ ++ /* build a super-simple fake AppData file */ ++ xml = g_strdup_printf ("\n" ++ "\n" ++ "%s\n" ++ "%s\n" ++ "\n", ++ xb_builder_source_ctx_get_filename (ctx), ++ icon); ++ return g_memory_input_stream_new_from_data (g_steal_pointer (&xml), -1, g_free); + } + + static gboolean +@@ -517,6 +558,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, + } + } + ++ /* regenerate with each minor release */ ++ xb_builder_append_guid (builder, PACKAGE_VERSION); ++ + /* create per-user cache */ + blobfn = gs_utils_get_cache_filename ("appstream", "components.xmlb", + GS_UTILS_CACHE_FLAG_WRITEABLE, +@@ -925,7 +969,7 @@ gs_plugin_add_installed (GsPlugin *plugin, + locker = g_rw_lock_reader_locker_new (&priv->silo_lock); + + /* get all installed appdata files (notice no 'components/' prefix...) */ +- components = xb_silo_query (priv->silo, "component", 0, NULL); ++ components = xb_silo_query (priv->silo, "component/name/..", 0, NULL); + if (components == NULL) + return TRUE; + for (guint i = 0; i < components->len; i++) { +-- +2.23.0 + diff --git a/gnome-software.spec b/gnome-software.spec index eb05e58..a01dd95 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,13 +12,16 @@ Name: gnome-software Version: 3.34.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{version}.tar.xz +# Backported from upstream +Patch1: 0001-Do-not-show-non-applications-in-the-installed-panel.patch + BuildRequires: gcc BuildRequires: gettext BuildRequires: libxslt @@ -220,6 +223,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Thu Oct 10 2019 Richard Hughes - 3.34.1-2 +- Backport a patch to correct the applications shown in the installed list +- Resolves #1759193 + * Mon Oct 07 2019 Kalev Lember - 3.34.1-1 - Update to 3.34.1 From 6788827f4dc32ce46e2842b2d27142e0158ad8cb Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 11 Oct 2019 15:47:42 +0100 Subject: [PATCH 02/14] Backport a better patch --- ...-applications-in-the-installed-panel.patch | 26 +++++++++++++------ gnome-software.spec | 6 ++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/0001-Do-not-show-non-applications-in-the-installed-panel.patch b/0001-Do-not-show-non-applications-in-the-installed-panel.patch index b208a03..aec84e0 100644 --- a/0001-Do-not-show-non-applications-in-the-installed-panel.patch +++ b/0001-Do-not-show-non-applications-in-the-installed-panel.patch @@ -1,4 +1,4 @@ -From 575d6dddb5d46dbb7955f5d3e248054d6d1996b8 Mon Sep 17 00:00:00 2001 +From 23f1fe1736b35fe15ca17a1388251f6b52628d46 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 8 Oct 2019 17:07:09 +0100 Subject: [PATCH] Do not show non-applications in the installed panel @@ -28,14 +28,14 @@ version to the libxmlb cache guid. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1759193 --- - plugins/core/gs-plugin-appstream.c | 62 +++++++++++++++++++++++++----- - 1 file changed, 53 insertions(+), 9 deletions(-) + plugins/core/gs-plugin-appstream.c | 72 ++++++++++++++++++++++++++---- + 1 file changed, 63 insertions(+), 9 deletions(-) diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c -index 1f18693b..5f5ed05c 100644 +index 1f18693b..4f5873cf 100644 --- a/plugins/core/gs-plugin-appstream.c +++ b/plugins/core/gs-plugin-appstream.c -@@ -206,20 +206,61 @@ gs_plugin_appstream_load_desktop_cb (XbBuilderSource *self, +@@ -206,20 +206,71 @@ gs_plugin_appstream_load_desktop_cb (XbBuilderSource *self, GCancellable *cancellable, GError **error) { @@ -44,6 +44,7 @@ index 1f18693b..5f5ed05c 100644 + g_autofree gchar *icon = NULL; + g_autofree gchar *type = NULL; + g_autofree gchar *xml = NULL; ++ g_autofree gchar *name = NULL; g_autoptr(GBytes) bytes = NULL; + g_autoptr(GKeyFile) kf = g_key_file_new (); + @@ -93,19 +94,28 @@ index 1f18693b..5f5ed05c 100644 + if (icon == NULL) + return NULL; + ++ name = g_key_file_get_string (kf, ++ G_KEY_FILE_DESKTOP_GROUP, ++ G_KEY_FILE_DESKTOP_KEY_NAME, ++ error); ++ if (name == NULL) ++ return NULL; ++ + /* build a super-simple fake AppData file */ + xml = g_strdup_printf ("\n" + "\n" + "%s\n" ++ "%s" + "%s\n" + "\n", + xb_builder_source_ctx_get_filename (ctx), ++ name, + icon); + return g_memory_input_stream_new_from_data (g_steal_pointer (&xml), -1, g_free); } static gboolean -@@ -517,6 +558,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, +@@ -517,6 +568,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, } } @@ -115,12 +125,12 @@ index 1f18693b..5f5ed05c 100644 /* create per-user cache */ blobfn = gs_utils_get_cache_filename ("appstream", "components.xmlb", GS_UTILS_CACHE_FLAG_WRITEABLE, -@@ -925,7 +969,7 @@ gs_plugin_add_installed (GsPlugin *plugin, +@@ -925,7 +979,7 @@ gs_plugin_add_installed (GsPlugin *plugin, locker = g_rw_lock_reader_locker_new (&priv->silo_lock); /* get all installed appdata files (notice no 'components/' prefix...) */ - components = xb_silo_query (priv->silo, "component", 0, NULL); -+ components = xb_silo_query (priv->silo, "component/name/..", 0, NULL); ++ components = xb_silo_query (priv->silo, "component/description/..", 0, NULL); if (components == NULL) return TRUE; for (guint i = 0; i < components->len; i++) { diff --git a/gnome-software.spec b/gnome-software.spec index a01dd95..febacfb 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -223,6 +223,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Oct 11 2019 Richard Hughes - 3.34.1-3 +- Backport a better patch to correct the installed applications +- Resolves #1759193 + * Thu Oct 10 2019 Richard Hughes - 3.34.1-2 - Backport a patch to correct the applications shown in the installed list - Resolves #1759193 From 2c178a1a44f3badbf25454e59b5ea5e2b73ca820 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 11 Oct 2019 19:38:45 +0100 Subject: [PATCH 03/14] Simpler patch --- ...-applications-in-the-installed-panel.patch | 124 +----------------- gnome-software.spec | 6 +- 2 files changed, 12 insertions(+), 118 deletions(-) diff --git a/0001-Do-not-show-non-applications-in-the-installed-panel.patch b/0001-Do-not-show-non-applications-in-the-installed-panel.patch index aec84e0..ae75c39 100644 --- a/0001-Do-not-show-non-applications-in-the-installed-panel.patch +++ b/0001-Do-not-show-non-applications-in-the-installed-panel.patch @@ -1,121 +1,14 @@ -From 23f1fe1736b35fe15ca17a1388251f6b52628d46 Mon Sep 17 00:00:00 2001 -From: Richard Hughes -Date: Tue, 8 Oct 2019 17:07:09 +0100 -Subject: [PATCH] Do not show non-applications in the installed panel +commit 65ab13c42001d125ec10322e488e5dd4b29a61f6 +Author: Richard Hughes +Date: Fri Oct 11 16:56:03 2019 +0100 -Using appstream-glib to parse the desktop files into fake AppStream components -had a drawback: it worked too well. What we wanted to do was only show -applications with AppData files in the installed list, only using the desktop -metadata if the icon could not be found in the AppStream metadata. - -Instead we showed all apps, even ones that would be disasterous if removed... - -Lets make this simpler; we can parse the desktop file directly. We only need -the icon and the component ID, so create a fake component without using -as_app_parse_data() at all. This should speed up initial startup, as we're -doing a lot less IO than before if there are a lot of desktop files installed. - -We'll also be storing less data (e.g. translations we're never going to use) in -the xmlb mmap store -- although it makes no difference to query speed it'll -make a difference for storage space. - -To ensure we only query AppData files for the installed list, we can now just -query for the existance of the tag -- which the fake components now will -not have. - -So that the xmlb store is regenerated with the fix, also add the package -version to the libxmlb cache guid. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1759193 ---- - plugins/core/gs-plugin-appstream.c | 72 ++++++++++++++++++++++++++---- - 1 file changed, 63 insertions(+), 9 deletions(-) + Do not show non-applications in the installed panel diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c -index 1f18693b..4f5873cf 100644 +index 1f18693b..4d8ba517 100644 --- a/plugins/core/gs-plugin-appstream.c +++ b/plugins/core/gs-plugin-appstream.c -@@ -206,20 +206,71 @@ gs_plugin_appstream_load_desktop_cb (XbBuilderSource *self, - GCancellable *cancellable, - GError **error) - { -- GString *xml; -- g_autoptr(AsApp) app = as_app_new (); -+ g_autofree gchar *icon = NULL; -+ g_autofree gchar *type = NULL; -+ g_autofree gchar *xml = NULL; -+ g_autofree gchar *name = NULL; - g_autoptr(GBytes) bytes = NULL; -+ g_autoptr(GKeyFile) kf = g_key_file_new (); -+ -+ /* get icon from desktop file */ - bytes = xb_builder_source_ctx_get_bytes (ctx, cancellable, error); - if (bytes == NULL) - return NULL; -- as_app_set_id (app, xb_builder_source_ctx_get_filename (ctx)); -- if (!as_app_parse_data (app, bytes, AS_APP_PARSE_FLAG_USE_FALLBACKS, error)) -+ if (!g_key_file_load_from_data (kf, -+ g_bytes_get_data (bytes, NULL), -+ g_bytes_get_size (bytes), -+ G_KEY_FILE_NONE, -+ error)) - return NULL; -- xml = as_app_to_xml (app, error); -- if (xml == NULL) -+ if (g_key_file_get_boolean (kf, -+ G_KEY_FILE_DESKTOP_GROUP, -+ G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, -+ NULL)) { -+ g_set_error_literal (error, -+ GS_PLUGIN_ERROR, -+ GS_PLUGIN_ERROR_NOT_SUPPORTED, -+ "NoDisplay=true"); - return NULL; -- g_string_prepend (xml, "\n"); -- return g_memory_input_stream_new_from_data (g_string_free (xml, FALSE), -1, g_free); -+ } -+ type = g_key_file_get_string (kf, -+ G_KEY_FILE_DESKTOP_GROUP, -+ G_KEY_FILE_DESKTOP_KEY_TYPE, -+ error); -+ if (type == NULL) -+ return NULL; -+ if (g_strcmp0 (type, G_KEY_FILE_DESKTOP_TYPE_APPLICATION) != 0) { -+ g_set_error (error, -+ GS_PLUGIN_ERROR, -+ GS_PLUGIN_ERROR_NOT_SUPPORTED, -+ "Type=%s", type); -+ return NULL; -+ } -+ icon = g_key_file_get_string (kf, -+ G_KEY_FILE_DESKTOP_GROUP, -+ G_KEY_FILE_DESKTOP_KEY_ICON, -+ error); -+ if (icon == NULL) -+ return NULL; -+ -+ name = g_key_file_get_string (kf, -+ G_KEY_FILE_DESKTOP_GROUP, -+ G_KEY_FILE_DESKTOP_KEY_NAME, -+ error); -+ if (name == NULL) -+ return NULL; -+ -+ /* build a super-simple fake AppData file */ -+ xml = g_strdup_printf ("\n" -+ "\n" -+ "%s\n" -+ "%s" -+ "%s\n" -+ "\n", -+ xb_builder_source_ctx_get_filename (ctx), -+ name, -+ icon); -+ return g_memory_input_stream_new_from_data (g_steal_pointer (&xml), -1, g_free); - } - - static gboolean -@@ -517,6 +568,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, +@@ -517,6 +517,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, } } @@ -125,7 +18,7 @@ index 1f18693b..4f5873cf 100644 /* create per-user cache */ blobfn = gs_utils_get_cache_filename ("appstream", "components.xmlb", GS_UTILS_CACHE_FLAG_WRITEABLE, -@@ -925,7 +979,7 @@ gs_plugin_add_installed (GsPlugin *plugin, +@@ -925,7 +928,7 @@ gs_plugin_add_installed (GsPlugin *plugin, locker = g_rw_lock_reader_locker_new (&priv->silo_lock); /* get all installed appdata files (notice no 'components/' prefix...) */ @@ -134,6 +27,3 @@ index 1f18693b..4f5873cf 100644 if (components == NULL) return TRUE; for (guint i = 0; i < components->len; i++) { --- -2.23.0 - diff --git a/gnome-software.spec b/gnome-software.spec index febacfb..e34e87f 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -223,6 +223,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Oct 11 2019 Richard Hughes - 3.34.1-4 +- Backport a simpler to correct the installed applications +- Resolves #1759193 + * Fri Oct 11 2019 Richard Hughes - 3.34.1-3 - Backport a better patch to correct the installed applications - Resolves #1759193 From 2042db16f227308542267ee92ec8554dc54ff9d9 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 14 Oct 2019 20:01:27 +0200 Subject: [PATCH 04/14] Update renamed appstream ids for GNOME 3.34 --- ...renamed-appstream-ids-for-GNOME-3.34.patch | 66 +++++++++++++++++++ gnome-software.spec | 6 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch diff --git a/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch b/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch new file mode 100644 index 0000000..296f15a --- /dev/null +++ b/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch @@ -0,0 +1,66 @@ +From d2c8b8b531792ff83163fd705b8bd2fd2d690884 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Mon, 14 Oct 2019 19:53:41 +0200 +Subject: [PATCH] Update renamed appstream ids for GNOME 3.34 + +--- + data/assets/org.gnome.Software.Featured.xml | 8 ++++---- + plugins/core/gs-plugin-hardcoded-popular.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/data/assets/org.gnome.Software.Featured.xml b/data/assets/org.gnome.Software.Featured.xml +index 188210f79..351de5604 100644 +--- a/data/assets/org.gnome.Software.Featured.xml ++++ b/data/assets/org.gnome.Software.Featured.xml +@@ -84,7 +84,7 @@ text-shadow: none; + + + +- org.gnome.Boxes ++ org.gnome.Boxes.desktop + + Featured + +@@ -111,7 +111,7 @@ text-shadow: none; + + + +- org.gnome.SoundRecorder ++ org.gnome.SoundRecorder.desktop + + border: 1px solid #bbb; + /* background: #f6f5f4 url('file://@datadir@/gnome-software/featured-sound-recorder.svg') +@@ -305,7 +305,7 @@ text-shadow: none; + + + +- org.gnome.Todo ++ org.gnome.Todo.desktop + + border: 1px solid transparent; + background: url('file://@datadir@/gnome-software/featured-todo-bg.jpg') center 40% repeat; +@@ -341,7 +341,7 @@ background: #1b2838 url('http://people.gnome.org/~jimmac/gnome-software/steam-lo + + + +- org.gnome.tetravex ++ org.gnome.Tetravex + + border: 1px solid transparent; + background: url('file://@datadir@/gnome-software/featured-tetravex-bg.jpg') center 45% repeat; +diff --git a/plugins/core/gs-plugin-hardcoded-popular.c b/plugins/core/gs-plugin-hardcoded-popular.c +index 7a2465998..3998a813b 100644 +--- a/plugins/core/gs-plugin-hardcoded-popular.c ++++ b/plugins/core/gs-plugin-hardcoded-popular.c +@@ -26,7 +26,7 @@ gs_plugin_add_popular (GsPlugin *plugin, + const gchar *apps[] = { + "org.gnome.Builder.desktop", + "org.gnome.Calculator.desktop", +- "org.gnome.clocks", ++ "org.gnome.clocks.desktop", + "org.gnome.Dictionary.desktop", + "org.gnome.Documents.desktop", + "org.gnome.Evince", +-- +2.23.0 + diff --git a/gnome-software.spec b/gnome-software.spec index e34e87f..be0dae8 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,6 +21,7 @@ Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{vers # Backported from upstream Patch1: 0001-Do-not-show-non-applications-in-the-installed-panel.patch +Patch2: 0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch BuildRequires: gcc BuildRequires: gettext @@ -223,6 +224,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Mon Oct 14 2019 Kalev Lember - 3.34.1-5 +- Update renamed appstream ids for GNOME 3.34 + * Fri Oct 11 2019 Richard Hughes - 3.34.1-4 - Backport a simpler to correct the installed applications - Resolves #1759193 From 778f8afc3370237ee882825c04e1f870b4c320cb Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 18 Oct 2019 13:59:19 +0200 Subject: [PATCH 05/14] Backport patches to fix a crash in gs_flatpak_get_installation https://bugzilla.redhat.com/show_bug.cgi?id=1762689 --- ...ut-function-to-group-by-installation.patch | 109 ++++++++++++++++ ...-Flatpak-updates-in-the-correct-inst.patch | 118 ++++++++++++++++++ gnome-software.spec | 7 +- 3 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 0001-flatpak-factor-out-function-to-group-by-installation.patch create mode 100644 0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch diff --git a/0001-flatpak-factor-out-function-to-group-by-installation.patch b/0001-flatpak-factor-out-function-to-group-by-installation.patch new file mode 100644 index 0000000..74021d7 --- /dev/null +++ b/0001-flatpak-factor-out-function-to-group-by-installation.patch @@ -0,0 +1,109 @@ +From cb926ab2645dbb548530c72f409d10736e584a2f Mon Sep 17 00:00:00 2001 +From: Will Thompson +Date: Fri, 27 Sep 2019 13:23:51 +0100 +Subject: [PATCH 1/2] flatpak: factor out function to group by installation + +I reworked it slightly to never put empty lists into the map, and to +make the caller iterate the hash table rather than looking up each +GsFlatpak * again. I think this is a bit clearer. + +This will be reused in gs_plugin_download(). +--- + plugins/flatpak/gs-plugin-flatpak.c | 70 +++++++++++++++++++---------- + 1 file changed, 46 insertions(+), 24 deletions(-) + +diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c +index 007eab752..b4bc9a90d 100644 +--- a/plugins/flatpak/gs-plugin-flatpak.c ++++ b/plugins/flatpak/gs-plugin-flatpak.c +@@ -405,6 +405,41 @@ _ref_to_app (FlatpakTransaction *transaction, const gchar *ref, GsPlugin *plugin + return gs_plugin_flatpak_find_app_by_ref (plugin, ref, NULL, NULL); + } + ++/* ++ * Returns: (transfer full) (element-type GsFlatpak GsAppList): ++ * a map from GsFlatpak to non-empty lists of apps from @list associated ++ * with that installation. ++ */ ++static GHashTable * ++_group_apps_by_installation (GsPlugin *plugin, ++ GsAppList *list) ++{ ++ g_autoptr(GHashTable) applist_by_flatpaks = NULL; ++ ++ /* list of apps to be handled by each flatpak installation */ ++ applist_by_flatpaks = g_hash_table_new_full (g_direct_hash, g_direct_equal, ++ (GDestroyNotify) g_object_unref, ++ (GDestroyNotify) g_object_unref); ++ ++ /* put each app into the correct per-GsFlatpak list */ ++ for (guint i = 0; i < gs_app_list_length (list); i++) { ++ GsApp *app = gs_app_list_index (list, i); ++ GsFlatpak *flatpak = gs_plugin_flatpak_get_handler (plugin, app); ++ if (flatpak != NULL) { ++ GsAppList *list_tmp = g_hash_table_lookup (applist_by_flatpaks, flatpak); ++ if (list_tmp == NULL) { ++ list_tmp = gs_app_list_new (); ++ g_hash_table_insert (applist_by_flatpaks, ++ g_object_ref (flatpak), ++ list_tmp); ++ } ++ gs_app_list_add (list_tmp, app); ++ } ++ } ++ ++ return g_steal_pointer (&applist_by_flatpaks); ++} ++ + static FlatpakTransaction * + _build_transaction (GsPlugin *plugin, GsFlatpak *flatpak, + GCancellable *cancellable, GError **error) +@@ -759,34 +794,21 @@ gs_plugin_update (GsPlugin *plugin, + GCancellable *cancellable, + GError **error) + { +- GsPluginData *priv = gs_plugin_get_data (plugin); + g_autoptr(GHashTable) applist_by_flatpaks = NULL; ++ GHashTableIter iter; ++ gpointer key, value; + +- /* list of apps to be handled by each flatpak installation */ +- applist_by_flatpaks = g_hash_table_new_full (g_direct_hash, g_direct_equal, +- NULL, (GDestroyNotify) g_object_unref); +- for (guint i = 0; i < priv->flatpaks->len; i++) { +- g_hash_table_insert (applist_by_flatpaks, +- g_ptr_array_index (priv->flatpaks, i), +- gs_app_list_new ()); +- } ++ /* build and run transaction for each flatpak installation */ ++ applist_by_flatpaks = _group_apps_by_installation (plugin, list); ++ g_hash_table_iter_init (&iter, applist_by_flatpaks); ++ while (g_hash_table_iter_next (&iter, &key, &value)) { ++ GsFlatpak *flatpak = GS_FLATPAK (key); ++ GsAppList *list_tmp = GS_APP_LIST (value); + +- /* put each app into the correct per-GsFlatpak list */ +- for (guint i = 0; i < gs_app_list_length (list); i++) { +- GsApp *app = gs_app_list_index (list, i); +- GsFlatpak *flatpak = gs_plugin_flatpak_get_handler (plugin, app); +- if (flatpak != NULL) { +- GsAppList *list_tmp = g_hash_table_lookup (applist_by_flatpaks, flatpak); +- gs_app_list_add (list_tmp, app); +- } +- } ++ g_assert (GS_IS_FLATPAK (flatpak)); ++ g_assert (list_tmp != NULL); ++ g_assert (gs_app_list_length (list_tmp) > 0); + +- /* build and run transaction for each flatpak installation */ +- for (guint j = 0; j < priv->flatpaks->len; j++) { +- GsFlatpak *flatpak = g_ptr_array_index (priv->flatpaks, j); +- GsAppList *list_tmp = GS_APP_LIST (g_hash_table_lookup (applist_by_flatpaks, flatpak)); +- if (gs_app_list_length (list_tmp) == 0) +- continue; + if (!gs_plugin_flatpak_update (plugin, flatpak, list_tmp, cancellable, error)) + return FALSE; + } +-- +2.23.0 + diff --git a/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch b/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch new file mode 100644 index 0000000..09b9a5d --- /dev/null +++ b/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch @@ -0,0 +1,118 @@ +From ba103a6cbb27a4e01524a5c27f76266613f87936 Mon Sep 17 00:00:00 2001 +From: Will Thompson +Date: Fri, 27 Sep 2019 13:44:27 +0100 +Subject: [PATCH 2/2] flatpak: download Flatpak updates in the correct + installation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Unfortunately the fix in 3e1fe203b40248f571be2a804027acd8e23dc54e is +incomplete: the call to _build_transaction() later in the function also +assumes that 'flatpak' is non-NULL. + +Apply the same fix as 12c3f646 to gs_plugin_download() – as +opposed to gs_plugin_update() – to group the apps by their flatpak +installation, and download each group independently. +--- + plugins/flatpak/gs-plugin-flatpak.c | 74 +++++++++++++++-------------- + 1 file changed, 39 insertions(+), 35 deletions(-) + +diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c +index b4bc9a90d..aed246fac 100644 +--- a/plugins/flatpak/gs-plugin-flatpak.c ++++ b/plugins/flatpak/gs-plugin-flatpak.c +@@ -475,51 +475,55 @@ gboolean + gs_plugin_download (GsPlugin *plugin, GsAppList *list, + GCancellable *cancellable, GError **error) + { +- GsFlatpak *flatpak = NULL; +- g_autoptr(FlatpakTransaction) transaction = NULL; +- g_autoptr(GsAppList) list_tmp = gs_app_list_new (); ++ g_autoptr(GHashTable) applist_by_flatpaks = NULL; ++ GHashTableIter iter; ++ gpointer key, value; + +- /* not supported */ +- for (guint i = 0; i < gs_app_list_length (list); i++) { +- GsApp *app = gs_app_list_index (list, i); +- flatpak = gs_plugin_flatpak_get_handler (plugin, app); +- if (flatpak != NULL) +- gs_app_list_add (list_tmp, app); +- } +- if (gs_app_list_length (list_tmp) == 0) +- return TRUE; ++ /* build and run transaction for each flatpak installation */ ++ applist_by_flatpaks = _group_apps_by_installation (plugin, list); ++ g_hash_table_iter_init (&iter, applist_by_flatpaks); ++ while (g_hash_table_iter_next (&iter, &key, &value)) { ++ GsFlatpak *flatpak = GS_FLATPAK (key); ++ GsAppList *list_tmp = GS_APP_LIST (value); ++ g_autoptr(FlatpakTransaction) transaction = NULL; + +- if (!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE)) { +- g_autoptr(GError) error_local = NULL; ++ g_assert (GS_IS_FLATPAK (flatpak)); ++ g_assert (list_tmp != NULL); ++ g_assert (gs_app_list_length (list_tmp) > 0); + +- if (!gs_metered_block_app_list_on_download_scheduler (list_tmp, cancellable, &error_local)) { +- g_warning ("Failed to block on download scheduler: %s", +- error_local->message); +- g_clear_error (&error_local); ++ if (!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE)) { ++ g_autoptr(GError) error_local = NULL; ++ ++ if (!gs_metered_block_app_list_on_download_scheduler (list_tmp, cancellable, &error_local)) { ++ g_warning ("Failed to block on download scheduler: %s", ++ error_local->message); ++ g_clear_error (&error_local); ++ } + } +- } + +- /* build and run non-deployed transaction */ +- transaction = _build_transaction (plugin, flatpak, cancellable, error); +- if (transaction == NULL) { +- gs_flatpak_error_convert (error); +- return FALSE; +- } +- flatpak_transaction_set_no_deploy (transaction, TRUE); +- for (guint i = 0; i < gs_app_list_length (list_tmp); i++) { +- GsApp *app = gs_app_list_index (list_tmp, i); +- g_autofree gchar *ref = NULL; ++ /* build and run non-deployed transaction */ ++ transaction = _build_transaction (plugin, flatpak, cancellable, error); ++ if (transaction == NULL) { ++ gs_flatpak_error_convert (error); ++ return FALSE; ++ } ++ flatpak_transaction_set_no_deploy (transaction, TRUE); ++ for (guint i = 0; i < gs_app_list_length (list_tmp); i++) { ++ GsApp *app = gs_app_list_index (list_tmp, i); ++ g_autofree gchar *ref = NULL; + +- ref = gs_flatpak_app_get_ref_display (app); +- if (!flatpak_transaction_add_update (transaction, ref, NULL, NULL, error)) { ++ ref = gs_flatpak_app_get_ref_display (app); ++ if (!flatpak_transaction_add_update (transaction, ref, NULL, NULL, error)) { ++ gs_flatpak_error_convert (error); ++ return FALSE; ++ } ++ } ++ if (!gs_flatpak_transaction_run (transaction, cancellable, error)) { + gs_flatpak_error_convert (error); + return FALSE; + } + } +- if (!gs_flatpak_transaction_run (transaction, cancellable, error)) { +- gs_flatpak_error_convert (error); +- return FALSE; +- } ++ + return TRUE; + } + +-- +2.23.0 + diff --git a/gnome-software.spec b/gnome-software.spec index be0dae8..27ca95e 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -22,6 +22,8 @@ Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{vers # Backported from upstream Patch1: 0001-Do-not-show-non-applications-in-the-installed-panel.patch Patch2: 0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch +Patch3: 0001-flatpak-factor-out-function-to-group-by-installation.patch +Patch4: 0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch BuildRequires: gcc BuildRequires: gettext @@ -224,6 +226,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Oct 18 2019 Kalev Lember - 3.34.1-6 +- Backport patches to fix a crash in gs_flatpak_get_installation (#1762689) + * Mon Oct 14 2019 Kalev Lember - 3.34.1-5 - Update renamed appstream ids for GNOME 3.34 From bcf7d2f7f5e057512078cb2ee926a849a49bb231 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 25 Nov 2019 10:14:13 +0000 Subject: [PATCH 06/14] Update to 3.34.2 --- .gitignore | 1 + ...-applications-in-the-installed-panel.patch | 29 ----- ...renamed-appstream-ids-for-GNOME-3.34.patch | 66 ---------- ...ut-function-to-group-by-installation.patch | 109 ---------------- ...-Flatpak-updates-in-the-correct-inst.patch | 118 ------------------ gnome-software.spec | 13 +- sources | 2 +- 7 files changed, 7 insertions(+), 331 deletions(-) delete mode 100644 0001-Do-not-show-non-applications-in-the-installed-panel.patch delete mode 100644 0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch delete mode 100644 0001-flatpak-factor-out-function-to-group-by-installation.patch delete mode 100644 0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch diff --git a/.gitignore b/.gitignore index 25ed2b3..7e57d31 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,4 @@ /gnome-software-3.32.4.tar.xz /gnome-software-3.34.0.tar.xz /gnome-software-3.34.1.tar.xz +/gnome-software-3.34.2.tar.xz diff --git a/0001-Do-not-show-non-applications-in-the-installed-panel.patch b/0001-Do-not-show-non-applications-in-the-installed-panel.patch deleted file mode 100644 index ae75c39..0000000 --- a/0001-Do-not-show-non-applications-in-the-installed-panel.patch +++ /dev/null @@ -1,29 +0,0 @@ -commit 65ab13c42001d125ec10322e488e5dd4b29a61f6 -Author: Richard Hughes -Date: Fri Oct 11 16:56:03 2019 +0100 - - Do not show non-applications in the installed panel - -diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c -index 1f18693b..4d8ba517 100644 ---- a/plugins/core/gs-plugin-appstream.c -+++ b/plugins/core/gs-plugin-appstream.c -@@ -517,6 +517,9 @@ gs_plugin_appstream_check_silo (GsPlugin *plugin, - } - } - -+ /* regenerate with each minor release */ -+ xb_builder_append_guid (builder, PACKAGE_VERSION); -+ - /* create per-user cache */ - blobfn = gs_utils_get_cache_filename ("appstream", "components.xmlb", - GS_UTILS_CACHE_FLAG_WRITEABLE, -@@ -925,7 +928,7 @@ gs_plugin_add_installed (GsPlugin *plugin, - locker = g_rw_lock_reader_locker_new (&priv->silo_lock); - - /* get all installed appdata files (notice no 'components/' prefix...) */ -- components = xb_silo_query (priv->silo, "component", 0, NULL); -+ components = xb_silo_query (priv->silo, "component/description/..", 0, NULL); - if (components == NULL) - return TRUE; - for (guint i = 0; i < components->len; i++) { diff --git a/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch b/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch deleted file mode 100644 index 296f15a..0000000 --- a/0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch +++ /dev/null @@ -1,66 +0,0 @@ -From d2c8b8b531792ff83163fd705b8bd2fd2d690884 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Mon, 14 Oct 2019 19:53:41 +0200 -Subject: [PATCH] Update renamed appstream ids for GNOME 3.34 - ---- - data/assets/org.gnome.Software.Featured.xml | 8 ++++---- - plugins/core/gs-plugin-hardcoded-popular.c | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/data/assets/org.gnome.Software.Featured.xml b/data/assets/org.gnome.Software.Featured.xml -index 188210f79..351de5604 100644 ---- a/data/assets/org.gnome.Software.Featured.xml -+++ b/data/assets/org.gnome.Software.Featured.xml -@@ -84,7 +84,7 @@ text-shadow: none; - - - -- org.gnome.Boxes -+ org.gnome.Boxes.desktop - - Featured - -@@ -111,7 +111,7 @@ text-shadow: none; - - - -- org.gnome.SoundRecorder -+ org.gnome.SoundRecorder.desktop - - border: 1px solid #bbb; - /* background: #f6f5f4 url('file://@datadir@/gnome-software/featured-sound-recorder.svg') -@@ -305,7 +305,7 @@ text-shadow: none; - - - -- org.gnome.Todo -+ org.gnome.Todo.desktop - - border: 1px solid transparent; - background: url('file://@datadir@/gnome-software/featured-todo-bg.jpg') center 40% repeat; -@@ -341,7 +341,7 @@ background: #1b2838 url('http://people.gnome.org/~jimmac/gnome-software/steam-lo - - - -- org.gnome.tetravex -+ org.gnome.Tetravex - - border: 1px solid transparent; - background: url('file://@datadir@/gnome-software/featured-tetravex-bg.jpg') center 45% repeat; -diff --git a/plugins/core/gs-plugin-hardcoded-popular.c b/plugins/core/gs-plugin-hardcoded-popular.c -index 7a2465998..3998a813b 100644 ---- a/plugins/core/gs-plugin-hardcoded-popular.c -+++ b/plugins/core/gs-plugin-hardcoded-popular.c -@@ -26,7 +26,7 @@ gs_plugin_add_popular (GsPlugin *plugin, - const gchar *apps[] = { - "org.gnome.Builder.desktop", - "org.gnome.Calculator.desktop", -- "org.gnome.clocks", -+ "org.gnome.clocks.desktop", - "org.gnome.Dictionary.desktop", - "org.gnome.Documents.desktop", - "org.gnome.Evince", --- -2.23.0 - diff --git a/0001-flatpak-factor-out-function-to-group-by-installation.patch b/0001-flatpak-factor-out-function-to-group-by-installation.patch deleted file mode 100644 index 74021d7..0000000 --- a/0001-flatpak-factor-out-function-to-group-by-installation.patch +++ /dev/null @@ -1,109 +0,0 @@ -From cb926ab2645dbb548530c72f409d10736e584a2f Mon Sep 17 00:00:00 2001 -From: Will Thompson -Date: Fri, 27 Sep 2019 13:23:51 +0100 -Subject: [PATCH 1/2] flatpak: factor out function to group by installation - -I reworked it slightly to never put empty lists into the map, and to -make the caller iterate the hash table rather than looking up each -GsFlatpak * again. I think this is a bit clearer. - -This will be reused in gs_plugin_download(). ---- - plugins/flatpak/gs-plugin-flatpak.c | 70 +++++++++++++++++++---------- - 1 file changed, 46 insertions(+), 24 deletions(-) - -diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c -index 007eab752..b4bc9a90d 100644 ---- a/plugins/flatpak/gs-plugin-flatpak.c -+++ b/plugins/flatpak/gs-plugin-flatpak.c -@@ -405,6 +405,41 @@ _ref_to_app (FlatpakTransaction *transaction, const gchar *ref, GsPlugin *plugin - return gs_plugin_flatpak_find_app_by_ref (plugin, ref, NULL, NULL); - } - -+/* -+ * Returns: (transfer full) (element-type GsFlatpak GsAppList): -+ * a map from GsFlatpak to non-empty lists of apps from @list associated -+ * with that installation. -+ */ -+static GHashTable * -+_group_apps_by_installation (GsPlugin *plugin, -+ GsAppList *list) -+{ -+ g_autoptr(GHashTable) applist_by_flatpaks = NULL; -+ -+ /* list of apps to be handled by each flatpak installation */ -+ applist_by_flatpaks = g_hash_table_new_full (g_direct_hash, g_direct_equal, -+ (GDestroyNotify) g_object_unref, -+ (GDestroyNotify) g_object_unref); -+ -+ /* put each app into the correct per-GsFlatpak list */ -+ for (guint i = 0; i < gs_app_list_length (list); i++) { -+ GsApp *app = gs_app_list_index (list, i); -+ GsFlatpak *flatpak = gs_plugin_flatpak_get_handler (plugin, app); -+ if (flatpak != NULL) { -+ GsAppList *list_tmp = g_hash_table_lookup (applist_by_flatpaks, flatpak); -+ if (list_tmp == NULL) { -+ list_tmp = gs_app_list_new (); -+ g_hash_table_insert (applist_by_flatpaks, -+ g_object_ref (flatpak), -+ list_tmp); -+ } -+ gs_app_list_add (list_tmp, app); -+ } -+ } -+ -+ return g_steal_pointer (&applist_by_flatpaks); -+} -+ - static FlatpakTransaction * - _build_transaction (GsPlugin *plugin, GsFlatpak *flatpak, - GCancellable *cancellable, GError **error) -@@ -759,34 +794,21 @@ gs_plugin_update (GsPlugin *plugin, - GCancellable *cancellable, - GError **error) - { -- GsPluginData *priv = gs_plugin_get_data (plugin); - g_autoptr(GHashTable) applist_by_flatpaks = NULL; -+ GHashTableIter iter; -+ gpointer key, value; - -- /* list of apps to be handled by each flatpak installation */ -- applist_by_flatpaks = g_hash_table_new_full (g_direct_hash, g_direct_equal, -- NULL, (GDestroyNotify) g_object_unref); -- for (guint i = 0; i < priv->flatpaks->len; i++) { -- g_hash_table_insert (applist_by_flatpaks, -- g_ptr_array_index (priv->flatpaks, i), -- gs_app_list_new ()); -- } -+ /* build and run transaction for each flatpak installation */ -+ applist_by_flatpaks = _group_apps_by_installation (plugin, list); -+ g_hash_table_iter_init (&iter, applist_by_flatpaks); -+ while (g_hash_table_iter_next (&iter, &key, &value)) { -+ GsFlatpak *flatpak = GS_FLATPAK (key); -+ GsAppList *list_tmp = GS_APP_LIST (value); - -- /* put each app into the correct per-GsFlatpak list */ -- for (guint i = 0; i < gs_app_list_length (list); i++) { -- GsApp *app = gs_app_list_index (list, i); -- GsFlatpak *flatpak = gs_plugin_flatpak_get_handler (plugin, app); -- if (flatpak != NULL) { -- GsAppList *list_tmp = g_hash_table_lookup (applist_by_flatpaks, flatpak); -- gs_app_list_add (list_tmp, app); -- } -- } -+ g_assert (GS_IS_FLATPAK (flatpak)); -+ g_assert (list_tmp != NULL); -+ g_assert (gs_app_list_length (list_tmp) > 0); - -- /* build and run transaction for each flatpak installation */ -- for (guint j = 0; j < priv->flatpaks->len; j++) { -- GsFlatpak *flatpak = g_ptr_array_index (priv->flatpaks, j); -- GsAppList *list_tmp = GS_APP_LIST (g_hash_table_lookup (applist_by_flatpaks, flatpak)); -- if (gs_app_list_length (list_tmp) == 0) -- continue; - if (!gs_plugin_flatpak_update (plugin, flatpak, list_tmp, cancellable, error)) - return FALSE; - } --- -2.23.0 - diff --git a/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch b/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch deleted file mode 100644 index 09b9a5d..0000000 --- a/0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch +++ /dev/null @@ -1,118 +0,0 @@ -From ba103a6cbb27a4e01524a5c27f76266613f87936 Mon Sep 17 00:00:00 2001 -From: Will Thompson -Date: Fri, 27 Sep 2019 13:44:27 +0100 -Subject: [PATCH 2/2] flatpak: download Flatpak updates in the correct - installation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Unfortunately the fix in 3e1fe203b40248f571be2a804027acd8e23dc54e is -incomplete: the call to _build_transaction() later in the function also -assumes that 'flatpak' is non-NULL. - -Apply the same fix as 12c3f646 to gs_plugin_download() – as -opposed to gs_plugin_update() – to group the apps by their flatpak -installation, and download each group independently. ---- - plugins/flatpak/gs-plugin-flatpak.c | 74 +++++++++++++++-------------- - 1 file changed, 39 insertions(+), 35 deletions(-) - -diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c -index b4bc9a90d..aed246fac 100644 ---- a/plugins/flatpak/gs-plugin-flatpak.c -+++ b/plugins/flatpak/gs-plugin-flatpak.c -@@ -475,51 +475,55 @@ gboolean - gs_plugin_download (GsPlugin *plugin, GsAppList *list, - GCancellable *cancellable, GError **error) - { -- GsFlatpak *flatpak = NULL; -- g_autoptr(FlatpakTransaction) transaction = NULL; -- g_autoptr(GsAppList) list_tmp = gs_app_list_new (); -+ g_autoptr(GHashTable) applist_by_flatpaks = NULL; -+ GHashTableIter iter; -+ gpointer key, value; - -- /* not supported */ -- for (guint i = 0; i < gs_app_list_length (list); i++) { -- GsApp *app = gs_app_list_index (list, i); -- flatpak = gs_plugin_flatpak_get_handler (plugin, app); -- if (flatpak != NULL) -- gs_app_list_add (list_tmp, app); -- } -- if (gs_app_list_length (list_tmp) == 0) -- return TRUE; -+ /* build and run transaction for each flatpak installation */ -+ applist_by_flatpaks = _group_apps_by_installation (plugin, list); -+ g_hash_table_iter_init (&iter, applist_by_flatpaks); -+ while (g_hash_table_iter_next (&iter, &key, &value)) { -+ GsFlatpak *flatpak = GS_FLATPAK (key); -+ GsAppList *list_tmp = GS_APP_LIST (value); -+ g_autoptr(FlatpakTransaction) transaction = NULL; - -- if (!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE)) { -- g_autoptr(GError) error_local = NULL; -+ g_assert (GS_IS_FLATPAK (flatpak)); -+ g_assert (list_tmp != NULL); -+ g_assert (gs_app_list_length (list_tmp) > 0); - -- if (!gs_metered_block_app_list_on_download_scheduler (list_tmp, cancellable, &error_local)) { -- g_warning ("Failed to block on download scheduler: %s", -- error_local->message); -- g_clear_error (&error_local); -+ if (!gs_plugin_has_flags (plugin, GS_PLUGIN_FLAGS_INTERACTIVE)) { -+ g_autoptr(GError) error_local = NULL; -+ -+ if (!gs_metered_block_app_list_on_download_scheduler (list_tmp, cancellable, &error_local)) { -+ g_warning ("Failed to block on download scheduler: %s", -+ error_local->message); -+ g_clear_error (&error_local); -+ } - } -- } - -- /* build and run non-deployed transaction */ -- transaction = _build_transaction (plugin, flatpak, cancellable, error); -- if (transaction == NULL) { -- gs_flatpak_error_convert (error); -- return FALSE; -- } -- flatpak_transaction_set_no_deploy (transaction, TRUE); -- for (guint i = 0; i < gs_app_list_length (list_tmp); i++) { -- GsApp *app = gs_app_list_index (list_tmp, i); -- g_autofree gchar *ref = NULL; -+ /* build and run non-deployed transaction */ -+ transaction = _build_transaction (plugin, flatpak, cancellable, error); -+ if (transaction == NULL) { -+ gs_flatpak_error_convert (error); -+ return FALSE; -+ } -+ flatpak_transaction_set_no_deploy (transaction, TRUE); -+ for (guint i = 0; i < gs_app_list_length (list_tmp); i++) { -+ GsApp *app = gs_app_list_index (list_tmp, i); -+ g_autofree gchar *ref = NULL; - -- ref = gs_flatpak_app_get_ref_display (app); -- if (!flatpak_transaction_add_update (transaction, ref, NULL, NULL, error)) { -+ ref = gs_flatpak_app_get_ref_display (app); -+ if (!flatpak_transaction_add_update (transaction, ref, NULL, NULL, error)) { -+ gs_flatpak_error_convert (error); -+ return FALSE; -+ } -+ } -+ if (!gs_flatpak_transaction_run (transaction, cancellable, error)) { - gs_flatpak_error_convert (error); - return FALSE; - } - } -- if (!gs_flatpak_transaction_run (transaction, cancellable, error)) { -- gs_flatpak_error_convert (error); -- return FALSE; -- } -+ - return TRUE; - } - --- -2.23.0 - diff --git a/gnome-software.spec b/gnome-software.spec index 27ca95e..9cb0884 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -11,20 +11,14 @@ %global libxmlb_version 0.1.7 Name: gnome-software -Version: 3.34.1 -Release: 6%{?dist} +Version: 3.34.2 +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{version}.tar.xz -# Backported from upstream -Patch1: 0001-Do-not-show-non-applications-in-the-installed-panel.patch -Patch2: 0001-Update-renamed-appstream-ids-for-GNOME-3.34.patch -Patch3: 0001-flatpak-factor-out-function-to-group-by-installation.patch -Patch4: 0002-flatpak-download-Flatpak-updates-in-the-correct-inst.patch - BuildRequires: gcc BuildRequires: gettext BuildRequires: libxslt @@ -226,6 +220,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Mon Nov 25 2019 Richard Hughes - 3.34.2-1 +- Update to 3.34.2 + * Fri Oct 18 2019 Kalev Lember - 3.34.1-6 - Backport patches to fix a crash in gs_flatpak_get_installation (#1762689) diff --git a/sources b/sources index 964d776..335aaac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-3.34.1.tar.xz) = 04bb9a587d90950966518c964256d29dfecd567ebb4996ad012c0bb3ed262bcd745a37887b4949ffbb4bac06f9fa3e19d342d14c6a82ef8762f5727fbf79468a +SHA512 (gnome-software-3.34.2.tar.xz) = 4deb09530fbeeadd54e69d03ef4cecaef47c6766bce0ec5230bb090d27e54664577a227416933b6ec4780249f4565e51202a25517fba5dd040fd895bd3a26397 From a46849c7a08401dc167ee21d4ccc9817690c7acb Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 6 Mar 2020 11:18:11 +0100 Subject: [PATCH 07/14] Add artwork for F32 Beta upgrades --- .gitignore | 1 + gnome-software.spec | 12 +++++++++++- sources | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e57d31..082691f 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ /gnome-software-3.34.0.tar.xz /gnome-software-3.34.1.tar.xz /gnome-software-3.34.2.tar.xz +/f32.png diff --git a/gnome-software.spec b/gnome-software.spec index 9cb0884..961e855 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,12 +12,14 @@ Name: gnome-software Version: 3.34.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{version}.tar.xz +# /usr/share/backgrounds/f32/default/f32.png from f32-backgrounds-base +Source1: f32.png BuildRequires: gcc BuildRequires: gettext @@ -135,6 +137,10 @@ cat >> %{buildroot}%{_datadir}/glib-2.0/schemas/org.gnome.software-fedora.gschem official-repos = [ 'anaconda', 'fedora', 'fedora-debuginfo', 'fedora-source', 'koji-override-0', 'koji-override-1', 'rawhide', 'rawhide-debuginfo', 'rawhide-source', 'updates', 'updates-debuginfo', 'updates-source', 'updates-testing', 'updates-testing-debuginfo', 'updates-testing-source', 'fedora-modular', 'fedora-modular-debuginfo', 'fedora-modular-source', 'rawhide-modular', 'rawhide-modular-debuginfo', 'rawhide-modular-source' ] FOE +# Install upgrade background image +mkdir -p %{buildroot}%{_datadir}/gnome-software/backgrounds +cp -a %{SOURCE1} %{buildroot}%{_datadir}/gnome-software/backgrounds/ + %find_lang %name --with-gnome %check @@ -152,6 +158,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*/apps/org.gnome.Software.svg %{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Software-symbolic.svg %{_datadir}/icons/hicolor/scalable/status/software-installed-symbolic.svg +%{_datadir}/gnome-software/backgrounds/ %{_datadir}/gnome-software/featured-*.svg %{_datadir}/gnome-software/featured-*.jpg %{_datadir}/metainfo/org.gnome.Software.appdata.xml @@ -220,6 +227,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Mar 06 2020 Kalev Lember - 3.34.2-2 +- Add artwork for F32 Beta upgrades + * Mon Nov 25 2019 Richard Hughes - 3.34.2-1 - Update to 3.34.2 diff --git a/sources b/sources index 335aaac..a3264ed 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (gnome-software-3.34.2.tar.xz) = 4deb09530fbeeadd54e69d03ef4cecaef47c6766bce0ec5230bb090d27e54664577a227416933b6ec4780249f4565e51202a25517fba5dd040fd895bd3a26397 +SHA512 (f32.png) = 1f5259d5dd096f1c2226a4d4565acf9b374ff763553f279dfc65356298a5ee057b8f5c208e226e0a44c8bf0e0da06daabd36d38a336725a8e3a1fe9dab0667ca From 8907933e33d1c28fa7152ca1ca154065369b2a54 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 27 Jan 2020 23:35:19 +0100 Subject: [PATCH 08/14] Fix various issues with rpm-ostree distro upgrades --- ...-downgrade-error-when-doing-distro-u.patch | 37 ++++++++ ...ee-Hook-up-distro-upgrade-triggering.patch | 88 +++++++++++++++++++ ...progress-when-downloading-distro-upg.patch | 26 ++++++ gnome-software.spec | 6 ++ 4 files changed, 157 insertions(+) create mode 100644 0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch create mode 100644 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch create mode 100644 0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch diff --git a/0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch b/0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch new file mode 100644 index 0000000..51179c8 --- /dev/null +++ b/0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch @@ -0,0 +1,37 @@ +From 1b0f83e1f6d6be12c3d645e28af38e30eb7fa77e Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Wed, 8 Jan 2020 14:57:40 +0100 +Subject: [PATCH 1/3] rpm-ostree: Avoid downgrade error when doing distro + upgrade + +Pass 'allow-downgrade' to rpm-ostree to avoid erroring out when doing a +distro upgrade from a chronologically newer Fedora compose (but older +distro version) to a chronologically older, but newer distro version. +--- + plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +index 8b0578a78..8e8da6f7a 100644 +--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c ++++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +@@ -1,6 +1,6 @@ + /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * +- * Copyright (C) 2017-2019 Kalev Lember ++ * Copyright (C) 2017-2020 Kalev Lember + * + * SPDX-License-Identifier: GPL-2.0+ + */ +@@ -1412,7 +1412,7 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin, + gs_app_get_version (app)); + + options = make_rpmostree_options_variant (FALSE, /* reboot */ +- FALSE, /* allow-downgrade */ ++ TRUE, /* allow-downgrade */ + FALSE, /* cache-only */ + TRUE, /* download-only */ + FALSE, /* skip-purge */ +-- +2.21.1 + diff --git a/0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch b/0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch new file mode 100644 index 0000000..3be66f3 --- /dev/null +++ b/0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch @@ -0,0 +1,88 @@ +From 2669a70169402abf86253f42f7d2d9bd13e5d070 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Thu, 9 Jan 2020 14:54:18 +0100 +Subject: [PATCH 2/3] rpm-ostree: Hook up distro upgrade triggering + +We were correctly downloading distro upgrades, but never deploying the +new version. + +Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/857 +--- + plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 61 +++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +index 8e8da6f7a..cccc7f5e0 100644 +--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c ++++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +@@ -928,6 +928,67 @@ gs_plugin_update_app (GsPlugin *plugin, + return TRUE; + } + ++gboolean ++gs_plugin_app_upgrade_trigger (GsPlugin *plugin, ++ GsApp *app, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ GsPluginData *priv = gs_plugin_get_data (plugin); ++ const char *packages[] = { NULL }; ++ g_autofree gchar *new_refspec = NULL; ++ g_autofree gchar *transaction_address = NULL; ++ g_autoptr(GVariant) options = NULL; ++ g_autoptr(TransactionProgress) tp = transaction_progress_new (); ++ ++ /* only process this app if was created by this plugin */ ++ if (g_strcmp0 (gs_app_get_management_plugin (app), gs_plugin_get_name (plugin)) != 0) ++ return TRUE; ++ ++ /* check is distro-upgrade */ ++ if (gs_app_get_kind (app) != AS_APP_KIND_OS_UPGRADE) ++ return TRUE; ++ ++ /* construct new refspec based on the distro version we're upgrading to */ ++ new_refspec = g_strdup_printf ("ostree://fedora/%s/x86_64/silverblue", ++ gs_app_get_version (app)); ++ ++ /* trigger the upgrade */ ++ options = make_rpmostree_options_variant (FALSE, /* reboot */ ++ TRUE, /* allow-downgrade */ ++ TRUE, /* cache-only */ ++ FALSE, /* download-only */ ++ FALSE, /* skip-purge */ ++ FALSE, /* no-pull-base */ ++ FALSE, /* dry-run */ ++ FALSE); /* no-overrides */ ++ ++ if (!gs_rpmostree_os_call_rebase_sync (priv->os_proxy, ++ options, ++ new_refspec, ++ packages, ++ NULL /* fd list */, ++ &transaction_address, ++ NULL /* fd list out */, ++ cancellable, ++ error)) { ++ gs_rpmostree_error_convert (error); ++ return FALSE; ++ } ++ ++ if (!gs_rpmostree_transaction_get_response_sync (priv->sysroot_proxy, ++ transaction_address, ++ tp, ++ cancellable, ++ error)) { ++ gs_rpmostree_error_convert (error); ++ return FALSE; ++ } ++ ++ /* success */ ++ return TRUE; ++} ++ + static gboolean + gs_plugin_repo_enable (GsPlugin *plugin, + GsApp *app, +-- +2.21.1 + diff --git a/0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch b/0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch new file mode 100644 index 0000000..4734f1f --- /dev/null +++ b/0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch @@ -0,0 +1,26 @@ +From 3f8fa5c87c414391b295769db7bb622c44a2916d Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Mon, 27 Jan 2020 23:15:55 +0100 +Subject: [PATCH 3/3] rpm-ostree: Show progress when downloading distro + upgrades + +--- + plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +index cccc7f5e0..0ceb4d2d6 100644 +--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c ++++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +@@ -1482,6 +1482,8 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin, + FALSE); /* no-overrides */ + + gs_app_set_state (app, AS_APP_STATE_INSTALLING); ++ tp->app = g_object_ref (app); ++ + if (!gs_rpmostree_os_call_rebase_sync (priv->os_proxy, + options, + new_refspec, +-- +2.21.1 + diff --git a/gnome-software.spec b/gnome-software.spec index 961e855..b49ea47 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -21,6 +21,11 @@ Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{vers # /usr/share/backgrounds/f32/default/f32.png from f32-backgrounds-base Source1: f32.png +# Fix various issues with rpm-ostree distro upgrades +Patch2: 0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch +Patch3: 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch +Patch4: 0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch + BuildRequires: gcc BuildRequires: gettext BuildRequires: libxslt @@ -229,6 +234,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %changelog * Fri Mar 06 2020 Kalev Lember - 3.34.2-2 - Add artwork for F32 Beta upgrades +- Fix various issues with rpm-ostree distro upgrades * Mon Nov 25 2019 Richard Hughes - 3.34.2-1 - Update to 3.34.2 From 49b34dc5e955805cd1f3d6f6ba11eb7f9bfac422 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 31 Jan 2020 13:48:10 +0100 Subject: [PATCH 09/14] Backport one more rpm-ostree distro upgrade fix --- ...-error-out-when-distro-upgrade-ref-i.patch | 51 +++++++++++++++++++ gnome-software.spec | 1 + 2 files changed, 52 insertions(+) create mode 100644 0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch diff --git a/0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch b/0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch new file mode 100644 index 0000000..4ad09f0 --- /dev/null +++ b/0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch @@ -0,0 +1,51 @@ +From 0c72aabd518632f5ad7f0851d3ea2d7c32eecc9a Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Fri, 31 Jan 2020 14:21:20 +0100 +Subject: [PATCH] rpm-ostree: Don't error out when distro upgrade ref is + already deployed + +--- + plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +index 0ceb4d2d..3811f935 100644 +--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c ++++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +@@ -982,7 +982,14 @@ gs_plugin_app_upgrade_trigger (GsPlugin *plugin, + cancellable, + error)) { + gs_rpmostree_error_convert (error); +- return FALSE; ++ ++ if (g_strrstr ((*error)->message, "Old and new refs are equal")) { ++ /* don't error out if the correct tree is already deployed */ ++ g_debug ("ignoring rpm-ostree error: %s", (*error)->message); ++ g_clear_error (error); ++ } else { ++ return FALSE; ++ } + } + + /* success */ +@@ -1504,8 +1511,15 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin, + cancellable, + error)) { + gs_rpmostree_error_convert (error); +- gs_app_set_state_recover (app); +- return FALSE; ++ ++ if (g_strrstr ((*error)->message, "Old and new refs are equal")) { ++ /* don't error out if the correct tree is already deployed */ ++ g_debug ("ignoring rpm-ostree error: %s", (*error)->message); ++ g_clear_error (error); ++ } else { ++ gs_app_set_state_recover (app); ++ return FALSE; ++ } + } + + /* state is known */ +-- +2.24.1 + diff --git a/gnome-software.spec b/gnome-software.spec index b49ea47..6adb9ff 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -25,6 +25,7 @@ Source1: f32.png Patch2: 0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch Patch3: 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch Patch4: 0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch +Patch5: 0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch BuildRequires: gcc BuildRequires: gettext From 96de893fed39a4470aa5795391c408d4960e709c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 6 Mar 2020 11:24:33 +0100 Subject: [PATCH 10/14] Show correct button for distro upgrades --- ...how-the-correct-button-when-NEEDS_RE.patch | 49 +++++++++++++++++++ gnome-software.spec | 4 ++ 2 files changed, 53 insertions(+) create mode 100644 0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch diff --git a/0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch b/0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch new file mode 100644 index 0000000..708b213 --- /dev/null +++ b/0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch @@ -0,0 +1,49 @@ +From 8b8f38fad7983e8ce30bb0b569cd42f18f524a90 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Mon, 2 Mar 2020 15:37:52 +0100 +Subject: [PATCH] upgrade banner: Show the correct button when NEEDS_REBOOT + quirk is set + +The logic here is that all distro upgrades need a reboot to *use* it, +but only some need a reboot to *deploy* it. We use the +GS_APP_QUIRK_NEEDS_REBOOT to denote distro upgrades that need to reboot +to deploy it, e.g. PackageKit distro upgrades or rpm-ostree rebases. +--- + src/gs-upgrade-banner.c | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/src/gs-upgrade-banner.c b/src/gs-upgrade-banner.c +index 51b369f5..8abe1d43 100644 +--- a/src/gs-upgrade-banner.c ++++ b/src/gs-upgrade-banner.c +@@ -57,20 +57,19 @@ gs_upgrade_banner_refresh (GsUpgradeBanner *self) + name_bold = g_strdup_printf ("%s", gs_app_get_name (priv->app)); + version_bold = g_strdup_printf ("%s", gs_app_get_version (priv->app)); + +- /* Show the right button text. Distributions which are based on OSTree +- * don’t need a post-reboot installation step. */ ++ /* Distributions that need to reboot to deploy the upgrade show the "Install" button */ + if (gs_app_has_quirk (priv->app, GS_APP_QUIRK_NEEDS_REBOOT)) { +- gtk_button_set_label (GTK_BUTTON (priv->button_upgrades_install), +- _("_Restart Now")); +- gtk_label_set_text (GTK_LABEL (priv->label_upgrades_warning), +- _("Updates will be applied when the " +- "computer is restarted.")); +- } else { + gtk_button_set_label (GTK_BUTTON (priv->button_upgrades_install), + _("_Install")); + gtk_label_set_text (GTK_LABEL (priv->label_upgrades_warning), + _("It is recommended that you back up your " + "data and files before upgrading.")); ++ } else { ++ gtk_button_set_label (GTK_BUTTON (priv->button_upgrades_install), ++ _("_Restart Now")); ++ gtk_label_set_text (GTK_LABEL (priv->label_upgrades_warning), ++ _("Updates will be applied when the " ++ "computer is restarted.")); + } + + /* Refresh the title. Normally a distro upgrade state goes from +-- +2.24.1 + diff --git a/gnome-software.spec b/gnome-software.spec index 6adb9ff..40a2366 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -21,6 +21,9 @@ Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{vers # /usr/share/backgrounds/f32/default/f32.png from f32-backgrounds-base Source1: f32.png +# Show correct button for distro upgrades +Patch1: 0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch + # Fix various issues with rpm-ostree distro upgrades Patch2: 0001-rpm-ostree-Avoid-downgrade-error-when-doing-distro-u.patch Patch3: 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch @@ -236,6 +239,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop * Fri Mar 06 2020 Kalev Lember - 3.34.2-2 - Add artwork for F32 Beta upgrades - Fix various issues with rpm-ostree distro upgrades +- Show correct button for distro upgrades * Mon Nov 25 2019 Richard Hughes - 3.34.2-1 - Update to 3.34.2 From 0a801ec139352065f218fc28a81766cf1e42fde2 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 3 Apr 2020 19:07:37 +0200 Subject: [PATCH 11/14] Use black text on F32 distro upgrade background image --- ...lack-font-for-Fedora-distro-upgrades.patch | 53 +++++++++++++++++++ ...-distro-upgrade-css-for-the-HC-theme.patch | 43 +++++++++++++++ gnome-software.spec | 9 +++- 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 0001-Use-black-font-for-Fedora-distro-upgrades.patch create mode 100644 0002-Add-distro-upgrade-css-for-the-HC-theme.patch diff --git a/0001-Use-black-font-for-Fedora-distro-upgrades.patch b/0001-Use-black-font-for-Fedora-distro-upgrades.patch new file mode 100644 index 0000000..27041f0 --- /dev/null +++ b/0001-Use-black-font-for-Fedora-distro-upgrades.patch @@ -0,0 +1,53 @@ +From d683ff504a176d9aa0e9ca3b833ddb33ba17645a Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Fri, 3 Apr 2020 15:46:50 +0200 +Subject: [PATCH 1/2] Use black font for Fedora distro upgrades + +This makes the text more legible on light backgrounds (such as the F32 +distro upgrade background). + +Fixes https://gitlab.gnome.org/GNOME/gnome-software/issues/956 +--- + .../gs-plugin-fedora-pkgdb-collections.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c +index e41bbc88..5862bae5 100644 +--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c ++++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c +@@ -229,8 +229,7 @@ _get_upgrade_css_background (guint version) + if (g_file_test (filename2, G_FILE_TEST_EXISTS)) + return g_strdup_printf ("url('%s')", filename2); + +- /* fall back to solid colour */ +- return g_strdup_printf ("#151E65"); ++ return NULL; + } + + static gint +@@ -295,13 +294,16 @@ _create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item) + item->version); + gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url); + +- /* use a fancy background */ ++ /* use a fancy background if possible */ + background = _get_upgrade_css_background (item->version); +- css = g_strdup_printf ("background: %s;" +- "background-position: center;" +- "background-size: cover;", +- background); +- gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css", css); ++ if (background != NULL) { ++ css = g_strdup_printf ("background: %s;" ++ "background-position: center;" ++ "background-size: cover;" ++ "color: black;", ++ background); ++ gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css", css); ++ } + + /* save in the cache */ + gs_plugin_cache_add (plugin, cache_key, app); +-- +2.25.2 + diff --git a/0002-Add-distro-upgrade-css-for-the-HC-theme.patch b/0002-Add-distro-upgrade-css-for-the-HC-theme.patch new file mode 100644 index 0000000..17977fa --- /dev/null +++ b/0002-Add-distro-upgrade-css-for-the-HC-theme.patch @@ -0,0 +1,43 @@ +From b4309196a15b1b59b7cc095b7d8ab8f5b2424e06 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Fri, 3 Apr 2020 16:00:12 +0200 +Subject: [PATCH 2/2] Add distro upgrade css for the HC theme + +Just copy the regular css over so that the banner doesn't look +completely off. +--- + src/gtk-style-hc.css | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/src/gtk-style-hc.css b/src/gtk-style-hc.css +index 959823e6..1006649e 100644 +--- a/src/gtk-style-hc.css ++++ b/src/gtk-style-hc.css +@@ -222,6 +222,24 @@ button.star, .button.star { + padding: 16px; + } + ++.upgrade-banner { ++ background-color: #1c5288; ++ padding: 0px; ++ border-radius: 4px; ++ border: 1px solid darker(@theme_bg_color); ++ color: @theme_selected_fg_color; ++} ++ ++.upgrade-buttons { ++ padding: 18px; ++ border-bottom-left-radius: 4px; ++ border-bottom-right-radius: 4px; ++} ++ ++.upgrade-progressbar { ++ box-shadow: none ++} ++ + .eol-box { + background-color: @theme_selected_bg_color; + border: 1px solid shade(@theme_selected_bg_color, 0.8); +-- +2.25.2 + diff --git a/gnome-software.spec b/gnome-software.spec index 40a2366..26a2aca 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -30,6 +30,10 @@ Patch3: 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch Patch4: 0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch Patch5: 0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch +# Use black text on F32 distro upgrade background image +Patch6: 0001-Use-black-font-for-Fedora-distro-upgrades.patch +Patch7: 0002-Add-distro-upgrade-css-for-the-HC-theme.patch + BuildRequires: gcc BuildRequires: gettext BuildRequires: libxslt @@ -236,6 +240,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Apr 03 2020 Kalev Lember - 3.34.2-3 +- Use black text on F32 distro upgrade background image + * Fri Mar 06 2020 Kalev Lember - 3.34.2-2 - Add artwork for F32 Beta upgrades - Fix various issues with rpm-ostree distro upgrades From 69b0aa6dec73db3952913fe73552a1ad23c03897 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 23 Apr 2020 14:43:33 +0200 Subject: [PATCH 12/14] Add final F32 artwork --- ...F32-upgrade-banner-position-and-font.patch | 29 +++++++++++++++++++ gnome-software.spec | 8 +++-- sources | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 0001-Fine-tune-F32-upgrade-banner-position-and-font.patch diff --git a/0001-Fine-tune-F32-upgrade-banner-position-and-font.patch b/0001-Fine-tune-F32-upgrade-banner-position-and-font.patch new file mode 100644 index 0000000..3f3afca --- /dev/null +++ b/0001-Fine-tune-F32-upgrade-banner-position-and-font.patch @@ -0,0 +1,29 @@ +From 9f6ada1d9caf72c77da75aa860643a4ac20796d2 Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Thu, 23 Apr 2020 14:37:21 +0200 +Subject: [PATCH] Fine-tune F32 upgrade banner position and font + +As per discussion with jimmac on #fedora-design. +--- + .../gs-plugin-fedora-pkgdb-collections.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c +index 5862bae5..0de24161 100644 +--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c ++++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c +@@ -298,9 +298,9 @@ _create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item) + background = _get_upgrade_css_background (item->version); + if (background != NULL) { + css = g_strdup_printf ("background: %s;" +- "background-position: center;" ++ "background-position: top;" + "background-size: cover;" +- "color: black;", ++ "color: white; text-shadow: 0 2px 2px rgba(0,0,0,0.5);", + background); + gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css", css); + } +-- +2.26.0 + diff --git a/gnome-software.spec b/gnome-software.spec index 26a2aca..e19fc3d 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -30,9 +30,10 @@ Patch3: 0002-rpm-ostree-Hook-up-distro-upgrade-triggering.patch Patch4: 0003-rpm-ostree-Show-progress-when-downloading-distro-upg.patch Patch5: 0001-rpm-ostree-Don-t-error-out-when-distro-upgrade-ref-i.patch -# Use black text on F32 distro upgrade background image +# Fine-tune F32 upgrade banner position and font Patch6: 0001-Use-black-font-for-Fedora-distro-upgrades.patch Patch7: 0002-Add-distro-upgrade-css-for-the-HC-theme.patch +Patch8: 0001-Fine-tune-F32-upgrade-banner-position-and-font.patch BuildRequires: gcc BuildRequires: gettext @@ -240,6 +241,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Thu Apr 23 2020 Kalev Lember - 3.34.2-4 +- Add final F32 artwork + * Fri Apr 03 2020 Kalev Lember - 3.34.2-3 - Use black text on F32 distro upgrade background image diff --git a/sources b/sources index a3264ed..7956181 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (gnome-software-3.34.2.tar.xz) = 4deb09530fbeeadd54e69d03ef4cecaef47c6766bce0ec5230bb090d27e54664577a227416933b6ec4780249f4565e51202a25517fba5dd040fd895bd3a26397 -SHA512 (f32.png) = 1f5259d5dd096f1c2226a4d4565acf9b374ff763553f279dfc65356298a5ee057b8f5c208e226e0a44c8bf0e0da06daabd36d38a336725a8e3a1fe9dab0667ca +SHA512 (f32.png) = 2adc08c5f4ca95f3fbf970bb77d4fda12ea4935d8bff707381d867d9ae90cf35b118444681dffb49229810d7c72f346d3f524d5bd7867d88c71b3ce8c04e1e05 From 20e756d6f4dfa38cddbeca36f52409eab6197c30 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 9 Sep 2020 11:13:39 +0200 Subject: [PATCH 13/14] Add artwork for F33 Beta upgrades --- .gitignore | 1 + gnome-software.spec | 10 ++++++++-- sources | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 082691f..995b379 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ /gnome-software-3.34.1.tar.xz /gnome-software-3.34.2.tar.xz /f32.png +/f33.png diff --git a/gnome-software.spec b/gnome-software.spec index e19fc3d..eb1400f 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -20,6 +20,8 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/3.34/%{name}-%{version}.tar.xz # /usr/share/backgrounds/f32/default/f32.png from f32-backgrounds-base Source1: f32.png +# /usr/share/backgrounds/f33/default/f33.png from f33-backgrounds-base +Source2: f33.png # Show correct button for distro upgrades Patch1: 0001-upgrade-banner-Show-the-correct-button-when-NEEDS_RE.patch @@ -152,8 +154,9 @@ official-repos = [ 'anaconda', 'fedora', 'fedora-debuginfo', 'fedora-source', 'k FOE # Install upgrade background image -mkdir -p %{buildroot}%{_datadir}/gnome-software/backgrounds +mkdir -p %{buildroot}%{_datadir}/gnome-software/backgrounds cp -a %{SOURCE1} %{buildroot}%{_datadir}/gnome-software/backgrounds/ +cp -a %{SOURCE2} %{buildroot}%{_datadir}/gnome-software/backgrounds/ %find_lang %name --with-gnome @@ -241,6 +244,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Wed Sep 09 2020 Kalev Lember - 3.34.2-5 +- Add artwork for F33 Beta upgrades + * Thu Apr 23 2020 Kalev Lember - 3.34.2-4 - Add final F32 artwork diff --git a/sources b/sources index 7956181..8b8dd14 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (gnome-software-3.34.2.tar.xz) = 4deb09530fbeeadd54e69d03ef4cecaef47c6766bce0ec5230bb090d27e54664577a227416933b6ec4780249f4565e51202a25517fba5dd040fd895bd3a26397 SHA512 (f32.png) = 2adc08c5f4ca95f3fbf970bb77d4fda12ea4935d8bff707381d867d9ae90cf35b118444681dffb49229810d7c72f346d3f524d5bd7867d88c71b3ce8c04e1e05 +SHA512 (f33.png) = ebeb5193412071aa8e49c915cbd33b0af3fe91143e8070d0bc6b11a3e5f2b4bed7142e764f482606bc42c349739cff501606a2ac5c39eec96ad64cdbc2bdf9a2 From 9b1bd014021ca58fd01f7aa0246553e110382ecc Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 16 Oct 2020 09:25:10 +0200 Subject: [PATCH 14/14] Update artwork for F33 Final upgrades --- gnome-software.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gnome-software.spec b/gnome-software.spec index eb1400f..1935765 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 3.34.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -244,6 +244,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/gnome-software-editor.1* %changelog +* Fri Oct 16 2020 Kalev Lember - 3.34.2-6 +- Update artwork for F33 Final upgrades + * Wed Sep 09 2020 Kalev Lember - 3.34.2-5 - Add artwork for F33 Beta upgrades diff --git a/sources b/sources index 8b8dd14..0209cee 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (gnome-software-3.34.2.tar.xz) = 4deb09530fbeeadd54e69d03ef4cecaef47c6766bce0ec5230bb090d27e54664577a227416933b6ec4780249f4565e51202a25517fba5dd040fd895bd3a26397 SHA512 (f32.png) = 2adc08c5f4ca95f3fbf970bb77d4fda12ea4935d8bff707381d867d9ae90cf35b118444681dffb49229810d7c72f346d3f524d5bd7867d88c71b3ce8c04e1e05 -SHA512 (f33.png) = ebeb5193412071aa8e49c915cbd33b0af3fe91143e8070d0bc6b11a3e5f2b4bed7142e764f482606bc42c349739cff501606a2ac5c39eec96ad64cdbc2bdf9a2 +SHA512 (f33.png) = 371b492d89f245c28f8ee56e154bcfdb4af0a5416323faab08cad0632993e82512301676ef21e26fce371c7d0af3c53b6a2c3539f43f5a6fa5fdc9f6911f6ad7