From 6e1e4a25c991a12ddb81da4c1cb3a3c8c27d44c6 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 23 Feb 2023 13:19:04 -0800 Subject: [PATCH] Backport MR #1635 to fix update notifications --- ...r-No-notification-of-prepared-update.patch | 45 +++++++++++++++++++ gnome-software.spec | 9 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 0001-gs-update-monitor-No-notification-of-prepared-update.patch diff --git a/0001-gs-update-monitor-No-notification-of-prepared-update.patch b/0001-gs-update-monitor-No-notification-of-prepared-update.patch new file mode 100644 index 0000000..bbb2276 --- /dev/null +++ b/0001-gs-update-monitor-No-notification-of-prepared-update.patch @@ -0,0 +1,45 @@ +From f6594bb461617a92801cfbe5dd4017898119b72d Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Thu, 23 Feb 2023 16:10:33 +0100 +Subject: [PATCH] gs-update-monitor: No notification of prepared updates + +This is a regression in 44.beta, the job returns empty list of apps, +because its existence only indicates success or failure. Due to that +there was not recognized any online nor offline update, thus no notification +was done afterwards. Check the app list used in the update job instead. +--- + src/gs-update-monitor.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c +index 6361ddbbb..b7ed2c344 100644 +--- a/src/gs-update-monitor.c ++++ b/src/gs-update-monitor.c +@@ -486,8 +486,9 @@ download_finished_cb (GObject *object, GAsyncResult *res, gpointer user_data) + g_autoptr(GsAppList) list = NULL; + g_autoptr(GsAppList) update_online = NULL; + g_autoptr(GsAppList) update_offline = NULL; ++ GsAppList *job_apps; + +- /* get result */ ++ /* the returned list is always empty, the existence indicates success */ + list = gs_plugin_loader_job_process_finish (plugin_loader, res, &error); + if (list == NULL) { + gs_plugin_loader_claim_job_error (plugin_loader, +@@ -497,10 +498,11 @@ download_finished_cb (GObject *object, GAsyncResult *res, gpointer user_data) + return; + } + ++ job_apps = gs_plugin_job_update_apps_get_apps (GS_PLUGIN_JOB_UPDATE_APPS (data->job)); + update_online = gs_app_list_new (); + update_offline = gs_app_list_new (); +- for (guint i = 0; i < gs_app_list_length (list); i++) { +- GsApp *app = gs_app_list_index (list, i); ++ for (guint i = 0; i < gs_app_list_length (job_apps); i++) { ++ GsApp *app = gs_app_list_index (job_apps, i); + if (_should_auto_update (app)) { + g_debug ("auto-updating %s", gs_app_get_unique_id (app)); + gs_app_list_add (update_online, app); +-- +2.39.2 + diff --git a/gnome-software.spec b/gnome-software.spec index a8e2a96..0cd68f2 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -21,7 +21,7 @@ Name: gnome-software Version: 44~beta -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPL-2.0-or-later @@ -29,6 +29,10 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/44/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +# https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1635 +# https://bugzilla.redhat.com/show_bug.cgi?id=2172662 +# Fix update notifications +Patch02: 0001-gs-update-monitor-No-notification-of-prepared-update.patch BuildRequires: docbook-style-xsl BuildRequires: desktop-file-utils @@ -228,6 +232,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software/ %changelog +* Thu Feb 23 2023 Adam Williamson - 44~beta-2 +- Backport MR #1635 to fix update notifications + * Tue Feb 14 2023 Milan Crha - 44.beta-1 - Update to 44.beta