From e15fddd1ebefe13b85df32f5beacba63085ab60f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 11 Feb 2022 11:39:45 +0100 Subject: [PATCH 01/18] Update to 42.beta --- gnome-software.spec | 12 +++++++----- sources | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gnome-software.spec b/gnome-software.spec index 221afbc..7929076 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -1,4 +1,5 @@ %global appstream_version 0.14.0 +%global libadwaita_version 1.0.1 %global libxmlb_version 0.1.7 %global glib2_version 2.61.1 %global gtk4_version 4.4.0 @@ -11,8 +12,8 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42~alpha -Release: 2%{?dist} +Version: 42~beta +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -36,7 +37,7 @@ BuildRequires: pkgconfig(gtk4) >= %{gtk4_version} BuildRequires: gtk-doc BuildRequires: json-glib-devel >= %{json_glib_version} BuildRequires: libdnf-devel -BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: pkgconfig(libadwaita-1) >= %{libadwaita_version} BuildRequires: libsoup-devel BuildRequires: libxmlb-devel >= %{libxmlb_version} BuildRequires: malcontent-devel @@ -147,8 +148,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_bindir}/gnome-software %{_datadir}/applications/gnome-software-local-file.desktop %{_datadir}/applications/org.gnome.Software.desktop -%dir %{_datadir}/gnome-software -%{_datadir}/gnome-software/*.png %{_mandir}/man1/gnome-software.1.gz %{_datadir}/icons/hicolor/*/apps/org.gnome.Software.svg %{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Software-symbolic.svg @@ -198,6 +197,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Fri Feb 11 2022 Milan Crha - 42.beta-1 +- Update to 42.beta + * Thu Jan 20 2022 Fedora Release Engineering - 42~alpha-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index 3210d9f..2f9377d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.alpha.tar.xz) = fa63ab4cffe72f9f8b348cd7e021da515963258271310d3933d985f00190c3ffe0f1d664d65ec5ff577d153c6de5d11eef9b1e6d9aa1e171d27f0f1b570dbdeb +SHA512 (gnome-software-42.beta.tar.xz) = 3ae22c9a37a134a6340191aabc7b02f6b53322820853aacd36e6d43893d7118d177defff44de93b627e488411798570b9c82c99b354966a899563e27d8c32a6a From dbdd7dcc5955af71d0dc0fa6785e1277f7ef0890 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 11 Feb 2022 12:28:17 +0100 Subject: [PATCH 02/18] Correct files list for popular plugin removal --- gnome-software.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnome-software.spec b/gnome-software.spec index 7929076..d77af53 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -166,7 +166,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_fwupd.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_generic-updates.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_hardcoded-blocklist.so -%{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_hardcoded-popular.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_icons.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_malcontent.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_modalias.so @@ -178,6 +177,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_rewrite-resource.so %{_sysconfdir}/xdg/autostart/gnome-software-service.desktop %{_datadir}/app-info/xmls/org.gnome.Software.Featured.xml +%{_datadir}/app-info/xmls/org.gnome.Software.Popular.xml %{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service %{_datadir}/dbus-1/services/org.gnome.Software.service %{_datadir}/gnome-shell/search-providers/org.gnome.Software-search-provider.ini From 899c5e4c98176047adac0a5f06021507455f7c7b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 16 Feb 2022 17:41:29 +0100 Subject: [PATCH 03/18] Resolves: #2054939 (Crash on a PackageKit app install) --- 0002-packagekit-crash-on-app-install.patch | 28 ++++++++++++++++++++++ gnome-software.spec | 6 ++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0002-packagekit-crash-on-app-install.patch diff --git a/0002-packagekit-crash-on-app-install.patch b/0002-packagekit-crash-on-app-install.patch new file mode 100644 index 0000000..04e85b3 --- /dev/null +++ b/0002-packagekit-crash-on-app-install.patch @@ -0,0 +1,28 @@ +From 73d1c9fd58d2fdf2c2d84e70cce678390679baa9 Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Wed, 16 Feb 2022 15:01:46 +0100 +Subject: [PATCH] PackageKit: Fix a crash on app install + +The array should be NULL-terminated, thus add the NULL at the end. + +Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1648 +--- + plugins/packagekit/gs-plugin-packagekit.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c +index 1ad913af5..56ddb1ccc 100644 +--- a/plugins/packagekit/gs-plugin-packagekit.c ++++ b/plugins/packagekit/gs-plugin-packagekit.c +@@ -612,6 +612,8 @@ gs_plugin_app_install (GsPlugin *plugin, + return FALSE; + } + ++ g_ptr_array_add (array_package_ids, NULL); ++ + gs_app_set_state (app, GS_APP_STATE_INSTALLING); + + for (i = 0; i < gs_app_list_length (addons); i++) { +-- +GitLab + diff --git a/gnome-software.spec b/gnome-software.spec index d77af53..b30cd16 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -13,7 +13,7 @@ Name: gnome-software Version: 42~beta -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,6 +21,7 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +Patch02: 0002-packagekit-crash-on-app-install.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -197,6 +198,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Wed Feb 16 2022 Milan Crha - 42.beta-2 +- Resolves: #2054939 (Crash on a PackageKit app install) + * Fri Feb 11 2022 Milan Crha - 42.beta-1 - Update to 42.beta From bb56a71e3c1aebbf4697e318fd8e19002a1008db Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 16 Feb 2022 17:49:57 +0100 Subject: [PATCH 04/18] Add a temporary workaround for gtk_widget_measure error flood on GsAppRow --- ...pprow-gtk_widget_measure-error-flood.patch | 39 +++++++++++++++++++ gnome-software.spec | 4 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch diff --git a/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch b/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch new file mode 100644 index 0000000..0a24881 --- /dev/null +++ b/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch @@ -0,0 +1,39 @@ +diff -up gnome-software-42.beta/src/gs-app-row.ui.3 gnome-software-42.beta/src/gs-app-row.ui +--- gnome-software-42.beta/src/gs-app-row.ui.3 2022-02-10 20:53:14.109477000 +0100 ++++ gnome-software-42.beta/src/gs-app-row.ui 2022-02-16 17:49:02.583817963 +0100 +@@ -26,7 +26,7 @@ + center + + +- True ++ False + 0.0 + 0.5 + end +@@ -80,7 +80,7 @@ + False + 0.0 + 0.5 +- True ++ False + word-char + end + 2 +@@ -119,7 +119,7 @@ + True + 24 + 24 +- True ++ False + word-char + end + 2 +@@ -187,7 +187,7 @@ + False + warning-text + start +- True ++ False + 0 + + diff --git a/gnome-software.spec b/gnome-software.spec index b30cd16..280f9df 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -22,6 +22,7 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-packagekit-crash-on-app-install.patch +Patch03: 0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -103,7 +104,7 @@ and update software in the GNOME desktop. This package includes the rpm-ostree backend. %prep -%autosetup -p1 -n %{name}-%{tarball_version} +%autosetup -p1 -S gendiff -n %{name}-%{tarball_version} %build %meson \ @@ -200,6 +201,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %changelog * Wed Feb 16 2022 Milan Crha - 42.beta-2 - Resolves: #2054939 (Crash on a PackageKit app install) +- Add a temporary workaround for gtk_widget_measure error flood on GsAppRow * Fri Feb 11 2022 Milan Crha - 42.beta-1 - Update to 42.beta From 6471906ccd9f7475f7c882f2ebd66d11fbc9cdee Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 7 Mar 2022 08:15:08 +0100 Subject: [PATCH 05/18] Update to 42.rc --- 0001-crash-with-broken-theme.patch | 24 ++++-------- 0002-packagekit-crash-on-app-install.patch | 28 ------------- ...pprow-gtk_widget_measure-error-flood.patch | 39 ------------------- gnome-software.spec | 11 +++--- sources | 2 +- 5 files changed, 14 insertions(+), 90 deletions(-) delete mode 100644 0002-packagekit-crash-on-app-install.patch delete mode 100644 0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch diff --git a/0001-crash-with-broken-theme.patch b/0001-crash-with-broken-theme.patch index fd37e80..ddbef4a 100644 --- a/0001-crash-with-broken-theme.patch +++ b/0001-crash-with-broken-theme.patch @@ -1,29 +1,22 @@ -From 3a644c151f27f439c36170f0958fd21cf1cc54d0 Mon Sep 17 00:00:00 2001 -From: Milan Crha -Date: Thu, 3 Jun 2021 08:33:53 +0200 Subject: [PATCH] gs-feature-tile: Do not abort when the theme is broken Just print a warning when the theme doesn't provide 'theme_fg_color' and fallback to black color. Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1228 ---- - src/gs-feature-tile.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) -diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c -index 1c85083eb..158af1e56 100644 ---- a/src/gs-feature-tile.c -+++ b/src/gs-feature-tile.c -@@ -268,7 +268,6 @@ gs_feature_tile_refresh (GsAppTile *self) +diff -up gnome-software-42.rc/src/gs-feature-tile.c.1 gnome-software-42.rc/src/gs-feature-tile.c +--- gnome-software-42.rc/src/gs-feature-tile.c.1 2022-03-04 16:23:58.566735700 +0100 ++++ gnome-software-42.rc/src/gs-feature-tile.c 2022-03-07 08:06:29.046595524 +0100 +@@ -411,7 +411,6 @@ gs_feature_tile_refresh (GsAppTile *self if (key_colors != tile->key_colors_cache) { g_autoptr(GArray) colors = NULL; GdkRGBA fg_rgba; - gboolean fg_rgba_valid; GsHSBC fg_hsbc; - - /* Look up the foreground colour for the feature tile, -@@ -283,8 +282,17 @@ gs_feature_tile_refresh (GsAppTile *self) + const GsHSBC *chosen_hsbc; + GsHSBC chosen_hsbc_modified; +@@ -429,8 +428,17 @@ gs_feature_tile_refresh (GsAppTile *self * @min_abs_contrast contrast with the foreground, so * that the text is legible. */ @@ -43,6 +36,3 @@ index 1c85083eb..158af1e56 100644 gtk_rgb_to_hsv (fg_rgba.red, fg_rgba.green, fg_rgba.blue, &fg_hsbc.hue, &fg_hsbc.saturation, &fg_hsbc.brightness); --- -GitLab - diff --git a/0002-packagekit-crash-on-app-install.patch b/0002-packagekit-crash-on-app-install.patch deleted file mode 100644 index 04e85b3..0000000 --- a/0002-packagekit-crash-on-app-install.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 73d1c9fd58d2fdf2c2d84e70cce678390679baa9 Mon Sep 17 00:00:00 2001 -From: Milan Crha -Date: Wed, 16 Feb 2022 15:01:46 +0100 -Subject: [PATCH] PackageKit: Fix a crash on app install - -The array should be NULL-terminated, thus add the NULL at the end. - -Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1648 ---- - plugins/packagekit/gs-plugin-packagekit.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c -index 1ad913af5..56ddb1ccc 100644 ---- a/plugins/packagekit/gs-plugin-packagekit.c -+++ b/plugins/packagekit/gs-plugin-packagekit.c -@@ -612,6 +612,8 @@ gs_plugin_app_install (GsPlugin *plugin, - return FALSE; - } - -+ g_ptr_array_add (array_package_ids, NULL); -+ - gs_app_set_state (app, GS_APP_STATE_INSTALLING); - - for (i = 0; i < gs_app_list_length (addons); i++) { --- -GitLab - diff --git a/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch b/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch deleted file mode 100644 index 0a24881..0000000 --- a/0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up gnome-software-42.beta/src/gs-app-row.ui.3 gnome-software-42.beta/src/gs-app-row.ui ---- gnome-software-42.beta/src/gs-app-row.ui.3 2022-02-10 20:53:14.109477000 +0100 -+++ gnome-software-42.beta/src/gs-app-row.ui 2022-02-16 17:49:02.583817963 +0100 -@@ -26,7 +26,7 @@ - center - - -- True -+ False - 0.0 - 0.5 - end -@@ -80,7 +80,7 @@ - False - 0.0 - 0.5 -- True -+ False - word-char - end - 2 -@@ -119,7 +119,7 @@ - True - 24 - 24 -- True -+ False - word-char - end - 2 -@@ -187,7 +187,7 @@ - False - warning-text - start -- True -+ False - 0 - - diff --git a/gnome-software.spec b/gnome-software.spec index 280f9df..fa6a841 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,8 +12,8 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42~beta -Release: 2%{?dist} +Version: 42~rc +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,8 +21,6 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch -Patch02: 0002-packagekit-crash-on-app-install.patch -Patch03: 0003-workaround-gsapprow-gtk_widget_measure-error-flood.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -177,7 +175,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_provenance.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_repos.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_rewrite-resource.so -%{_sysconfdir}/xdg/autostart/gnome-software-service.desktop +%{_sysconfdir}/xdg/autostart/org.gnome.Software.desktop %{_datadir}/app-info/xmls/org.gnome.Software.Featured.xml %{_datadir}/app-info/xmls/org.gnome.Software.Popular.xml %{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service @@ -199,6 +197,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Mon Mar 07 2022 Milan Crha - 42.rc-1 +- Update to 42.rc + * Wed Feb 16 2022 Milan Crha - 42.beta-2 - Resolves: #2054939 (Crash on a PackageKit app install) - Add a temporary workaround for gtk_widget_measure error flood on GsAppRow diff --git a/sources b/sources index 2f9377d..6afee80 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.beta.tar.xz) = 3ae22c9a37a134a6340191aabc7b02f6b53322820853aacd36e6d43893d7118d177defff44de93b627e488411798570b9c82c99b354966a899563e27d8c32a6a +SHA512 (gnome-software-42.rc.tar.xz) = cd9c465d73b8998c0ebc49d5e40fec22522e0f125cbce5ff59a7a13d779a3793ac57dfb606d9b918e0c198b6b6cd62657483dc8e83a77ed84966c5f44980f38b From b9100dc16794ddaf6b3131758a20312bcd5379c3 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 10 Mar 2022 17:34:44 +0100 Subject: [PATCH 06/18] Add upstream patches for gs-download-utils (i#1677 and i#1679) --- 1282.patch | 182 ++++++++++++++++++++++++++++++++++++++++++++ 1285.patch | 45 +++++++++++ gnome-software.spec | 7 +- 3 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 1282.patch create mode 100644 1285.patch diff --git a/1282.patch b/1282.patch new file mode 100644 index 0000000..f6cc6fd --- /dev/null +++ b/1282.patch @@ -0,0 +1,182 @@ +From edbeab87ce5aa48bd9fe49dd22acfcce2b8b0fc0 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 10 Mar 2022 13:20:58 +0000 +Subject: [PATCH 1/3] =?UTF-8?q?gs-download-utils:=20Don=E2=80=99t=20use=20?= + =?UTF-8?q?ETag=20when=20writing=20local=20file?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The ETag we care about for the download is the ETag returned by the +server, not the ETag of the local file. Passing the server’s ETag to the +local file operations may result in the local file not being written to, +with a “The file was externally modified” error. + +Signed-off-by: Philip Withnall + +Fixes: #1677 +--- + lib/gs-download-utils.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/lib/gs-download-utils.c b/lib/gs-download-utils.c +index f3a64479b..a6d930587 100644 +--- a/lib/gs-download-utils.c ++++ b/lib/gs-download-utils.c +@@ -134,6 +134,9 @@ static void download_progress (GTask *task); + * existing content of the output stream (if it’s a file, for example) will not + * be overwritten. + * ++ * Note that @last_etag must be the ETag value returned by the server last time ++ * the file was downloaded, not the local file ETag generated by GLib. ++ * + * If specified, @progress_callback will be called zero or more times until + * @callback is called, providing progress updates on the download. + * +@@ -644,9 +647,20 @@ gs_download_file_async (SoupSession *soup_session, + /* Query the old ETag if the file already exists. */ + data->last_etag = gs_utils_get_file_etag (output_file, cancellable); + +- /* Create the output file. */ ++ /* Create the output file. ++ * ++ * Note that `data->last_etag` is *not* passed in here, as the ETag from ++ * the server and the file modification ETag that GLib uses are ++ * different things. For g_file_replace_async(), GLib always uses an ++ * ETag it generates internally based on the file mtime (see ++ * _g_local_file_info_create_etag()), which will never match what the ++ * server returns in its ETag header. ++ * ++ * This is fine, as we are using the ETag to avoid an unnecessary HTTP ++ * download if possible. We don’t care about tracking changes to the ++ * file on disk. */ + g_file_replace_async (output_file, +- data->last_etag, ++ NULL, /* ETag */ + FALSE, /* make_backup */ + G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, + io_priority, +@@ -699,7 +713,7 @@ download_file_cb (GObject *source_object, + return; + } + +- /* Update the ETag. */ ++ /* Update the stored HTTP ETag. */ + gs_utils_set_file_etag (data->output_file, new_etag, cancellable); + + g_task_return_boolean (task, TRUE); +-- +GitLab + + +From 040e2dca3904d965450158dcdaeedfca12965682 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 10 Mar 2022 13:27:21 +0000 +Subject: [PATCH 2/3] gs-utils: Add some debug messages for getting/setting + ETags + +Signed-off-by: Philip Withnall + +Helps: #1677 +--- + lib/gs-utils.c | 28 +++++++++++++++++++++++----- + 1 file changed, 23 insertions(+), 5 deletions(-) + +diff --git a/lib/gs-utils.c b/lib/gs-utils.c +index 89349b1fe..6dc4d28a0 100644 +--- a/lib/gs-utils.c ++++ b/lib/gs-utils.c +@@ -1509,14 +1509,18 @@ gs_utils_get_file_etag (GFile *file, + GCancellable *cancellable) + { + g_autoptr(GFileInfo) info = NULL; ++ g_autoptr(GError) local_error = NULL; + + g_return_val_if_fail (G_IS_FILE (file), NULL); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); + +- info = g_file_query_info (file, METADATA_ETAG_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, cancellable, NULL); ++ info = g_file_query_info (file, METADATA_ETAG_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, cancellable, &local_error); + +- if (info == NULL) ++ if (info == NULL) { ++ g_debug ("Error getting attribute ‘%s’ for file ‘%s’: %s", ++ METADATA_ETAG_ATTRIBUTE, g_file_peek_path (file), local_error->message); + return NULL; ++ } + + return g_strdup (g_file_info_get_attribute_string (info, METADATA_ETAG_ATTRIBUTE)); + } +@@ -1542,15 +1546,29 @@ gs_utils_set_file_etag (GFile *file, + const gchar *etag, + GCancellable *cancellable) + { ++ g_autoptr(GError) local_error = NULL; ++ + g_return_val_if_fail (G_IS_FILE (file), FALSE); + g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); + + if (etag == NULL || *etag == '\0') { +- return g_file_set_attribute (file, METADATA_ETAG_ATTRIBUTE, G_FILE_ATTRIBUTE_TYPE_INVALID, +- NULL, G_FILE_QUERY_INFO_NONE, cancellable, NULL); ++ if (!g_file_set_attribute (file, METADATA_ETAG_ATTRIBUTE, G_FILE_ATTRIBUTE_TYPE_INVALID, ++ NULL, G_FILE_QUERY_INFO_NONE, cancellable, &local_error)) { ++ g_debug ("Error clearing attribute ‘%s’ on file ‘%s’: %s", ++ METADATA_ETAG_ATTRIBUTE, g_file_peek_path (file), local_error->message); ++ return FALSE; ++ } ++ ++ return TRUE; ++ } ++ ++ if (!g_file_set_attribute_string (file, METADATA_ETAG_ATTRIBUTE, etag, G_FILE_QUERY_INFO_NONE, cancellable, &local_error)) { ++ g_debug ("Error setting attribute ‘%s’ to ‘%s’ on file ‘%s’: %s", ++ METADATA_ETAG_ATTRIBUTE, etag, g_file_peek_path (file), local_error->message); ++ return FALSE; + } + +- return g_file_set_attribute_string (file, METADATA_ETAG_ATTRIBUTE, etag, G_FILE_QUERY_INFO_NONE, cancellable, NULL); ++ return TRUE; + } + + /** +-- +GitLab + + +From c46d656c51938adb994b4597c766259bf1813fe5 Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 10 Mar 2022 13:27:50 +0000 +Subject: [PATCH 3/3] gs-utils: Change ETag attribute namespace from metadata + to xattr +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The xattr namespace is likely to be supported on all modern Linux +distributions for local files, and doesn’t require IPC with +`gvfsd-metadata`. + +Signed-off-by: Philip Withnall + +Helps: #1677 +--- + lib/gs-utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/gs-utils.c b/lib/gs-utils.c +index 6dc4d28a0..b8eefe36e 100644 +--- a/lib/gs-utils.c ++++ b/lib/gs-utils.c +@@ -1488,7 +1488,7 @@ gs_utils_get_file_size (const gchar *filename, + return size; + } + +-#define METADATA_ETAG_ATTRIBUTE "metadata::etag" ++#define METADATA_ETAG_ATTRIBUTE "xattr::gnome-software::etag" + + /** + * gs_utils_get_file_etag: +-- +GitLab + diff --git a/1285.patch b/1285.patch new file mode 100644 index 0000000..1caae0c --- /dev/null +++ b/1285.patch @@ -0,0 +1,45 @@ +From 92da7c98217856785dfea518890fa25acd3a055e Mon Sep 17 00:00:00 2001 +From: Philip Withnall +Date: Thu, 10 Mar 2022 14:25:05 +0000 +Subject: [PATCH] =?UTF-8?q?gs-download-utils:=20Ignore=20cancellation=20er?= + =?UTF-8?q?rors=20when=20there=E2=80=99s=20a=20cache=20hit?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In order to avoid overwriting an existing cache file when the server has +said it’s up to date, we cancel closing the output stream. + +Avoid propagating that cancellation error up to the caller; to them, the +operation should seem like a success rather than returning +`G_IO_ERROR_CANCELLED`. + +Signed-off-by: Philip Withnall + +Fixes: #1679 +--- + lib/gs-download-utils.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/lib/gs-download-utils.c b/lib/gs-download-utils.c +index f3a64479b..4ab15c098 100644 +--- a/lib/gs-download-utils.c ++++ b/lib/gs-download-utils.c +@@ -467,7 +467,13 @@ close_stream_cb (GObject *source_object, + * overwrite errors set earlier in the operation. */ + if (!g_output_stream_close_finish (G_OUTPUT_STREAM (source_object), + result, &local_error)) { +- if (data->error == NULL) ++ /* If we are aborting writing the output stream (perhaps ++ * because of a cache hit), don’t report the error at ++ * all. */ ++ if (data->discard_output_stream && ++ g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ g_clear_error (&local_error); ++ else if (data->error == NULL) + data->error = g_steal_pointer (&local_error); + else if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_debug ("Error closing output stream: %s", local_error->message); +-- +GitLab + diff --git a/gnome-software.spec b/gnome-software.spec index fa6a841..d3ac2cb 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -13,7 +13,7 @@ Name: gnome-software Version: 42~rc -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,6 +21,8 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +Patch02: 1282.patch +Patch03: 1285.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -197,6 +199,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Thu Mar 10 2022 Milan Crha - 42.rc-2 +- Add upstream patches for gs-download-utils (i#1677 and i#1679) + * Mon Mar 07 2022 Milan Crha - 42.rc-1 - Update to 42.rc From 7db8bcfe383189a9c1c5443c0fb5b3f9c0253deb Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 18 Mar 2022 10:13:22 +0100 Subject: [PATCH 07/18] Update to 42.0 --- 1282.patch | 182 -------------------------------------------- 1285.patch | 45 ----------- gnome-software.spec | 9 ++- sources | 2 +- 4 files changed, 6 insertions(+), 232 deletions(-) delete mode 100644 1282.patch delete mode 100644 1285.patch diff --git a/1282.patch b/1282.patch deleted file mode 100644 index f6cc6fd..0000000 --- a/1282.patch +++ /dev/null @@ -1,182 +0,0 @@ -From edbeab87ce5aa48bd9fe49dd22acfcce2b8b0fc0 Mon Sep 17 00:00:00 2001 -From: Philip Withnall -Date: Thu, 10 Mar 2022 13:20:58 +0000 -Subject: [PATCH 1/3] =?UTF-8?q?gs-download-utils:=20Don=E2=80=99t=20use=20?= - =?UTF-8?q?ETag=20when=20writing=20local=20file?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The ETag we care about for the download is the ETag returned by the -server, not the ETag of the local file. Passing the server’s ETag to the -local file operations may result in the local file not being written to, -with a “The file was externally modified” error. - -Signed-off-by: Philip Withnall - -Fixes: #1677 ---- - lib/gs-download-utils.c | 20 +++++++++++++++++--- - 1 file changed, 17 insertions(+), 3 deletions(-) - -diff --git a/lib/gs-download-utils.c b/lib/gs-download-utils.c -index f3a64479b..a6d930587 100644 ---- a/lib/gs-download-utils.c -+++ b/lib/gs-download-utils.c -@@ -134,6 +134,9 @@ static void download_progress (GTask *task); - * existing content of the output stream (if it’s a file, for example) will not - * be overwritten. - * -+ * Note that @last_etag must be the ETag value returned by the server last time -+ * the file was downloaded, not the local file ETag generated by GLib. -+ * - * If specified, @progress_callback will be called zero or more times until - * @callback is called, providing progress updates on the download. - * -@@ -644,9 +647,20 @@ gs_download_file_async (SoupSession *soup_session, - /* Query the old ETag if the file already exists. */ - data->last_etag = gs_utils_get_file_etag (output_file, cancellable); - -- /* Create the output file. */ -+ /* Create the output file. -+ * -+ * Note that `data->last_etag` is *not* passed in here, as the ETag from -+ * the server and the file modification ETag that GLib uses are -+ * different things. For g_file_replace_async(), GLib always uses an -+ * ETag it generates internally based on the file mtime (see -+ * _g_local_file_info_create_etag()), which will never match what the -+ * server returns in its ETag header. -+ * -+ * This is fine, as we are using the ETag to avoid an unnecessary HTTP -+ * download if possible. We don’t care about tracking changes to the -+ * file on disk. */ - g_file_replace_async (output_file, -- data->last_etag, -+ NULL, /* ETag */ - FALSE, /* make_backup */ - G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, - io_priority, -@@ -699,7 +713,7 @@ download_file_cb (GObject *source_object, - return; - } - -- /* Update the ETag. */ -+ /* Update the stored HTTP ETag. */ - gs_utils_set_file_etag (data->output_file, new_etag, cancellable); - - g_task_return_boolean (task, TRUE); --- -GitLab - - -From 040e2dca3904d965450158dcdaeedfca12965682 Mon Sep 17 00:00:00 2001 -From: Philip Withnall -Date: Thu, 10 Mar 2022 13:27:21 +0000 -Subject: [PATCH 2/3] gs-utils: Add some debug messages for getting/setting - ETags - -Signed-off-by: Philip Withnall - -Helps: #1677 ---- - lib/gs-utils.c | 28 +++++++++++++++++++++++----- - 1 file changed, 23 insertions(+), 5 deletions(-) - -diff --git a/lib/gs-utils.c b/lib/gs-utils.c -index 89349b1fe..6dc4d28a0 100644 ---- a/lib/gs-utils.c -+++ b/lib/gs-utils.c -@@ -1509,14 +1509,18 @@ gs_utils_get_file_etag (GFile *file, - GCancellable *cancellable) - { - g_autoptr(GFileInfo) info = NULL; -+ g_autoptr(GError) local_error = NULL; - - g_return_val_if_fail (G_IS_FILE (file), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - -- info = g_file_query_info (file, METADATA_ETAG_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, cancellable, NULL); -+ info = g_file_query_info (file, METADATA_ETAG_ATTRIBUTE, G_FILE_QUERY_INFO_NONE, cancellable, &local_error); - -- if (info == NULL) -+ if (info == NULL) { -+ g_debug ("Error getting attribute ‘%s’ for file ‘%s’: %s", -+ METADATA_ETAG_ATTRIBUTE, g_file_peek_path (file), local_error->message); - return NULL; -+ } - - return g_strdup (g_file_info_get_attribute_string (info, METADATA_ETAG_ATTRIBUTE)); - } -@@ -1542,15 +1546,29 @@ gs_utils_set_file_etag (GFile *file, - const gchar *etag, - GCancellable *cancellable) - { -+ g_autoptr(GError) local_error = NULL; -+ - g_return_val_if_fail (G_IS_FILE (file), FALSE); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); - - if (etag == NULL || *etag == '\0') { -- return g_file_set_attribute (file, METADATA_ETAG_ATTRIBUTE, G_FILE_ATTRIBUTE_TYPE_INVALID, -- NULL, G_FILE_QUERY_INFO_NONE, cancellable, NULL); -+ if (!g_file_set_attribute (file, METADATA_ETAG_ATTRIBUTE, G_FILE_ATTRIBUTE_TYPE_INVALID, -+ NULL, G_FILE_QUERY_INFO_NONE, cancellable, &local_error)) { -+ g_debug ("Error clearing attribute ‘%s’ on file ‘%s’: %s", -+ METADATA_ETAG_ATTRIBUTE, g_file_peek_path (file), local_error->message); -+ return FALSE; -+ } -+ -+ return TRUE; -+ } -+ -+ if (!g_file_set_attribute_string (file, METADATA_ETAG_ATTRIBUTE, etag, G_FILE_QUERY_INFO_NONE, cancellable, &local_error)) { -+ g_debug ("Error setting attribute ‘%s’ to ‘%s’ on file ‘%s’: %s", -+ METADATA_ETAG_ATTRIBUTE, etag, g_file_peek_path (file), local_error->message); -+ return FALSE; - } - -- return g_file_set_attribute_string (file, METADATA_ETAG_ATTRIBUTE, etag, G_FILE_QUERY_INFO_NONE, cancellable, NULL); -+ return TRUE; - } - - /** --- -GitLab - - -From c46d656c51938adb994b4597c766259bf1813fe5 Mon Sep 17 00:00:00 2001 -From: Philip Withnall -Date: Thu, 10 Mar 2022 13:27:50 +0000 -Subject: [PATCH 3/3] gs-utils: Change ETag attribute namespace from metadata - to xattr -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The xattr namespace is likely to be supported on all modern Linux -distributions for local files, and doesn’t require IPC with -`gvfsd-metadata`. - -Signed-off-by: Philip Withnall - -Helps: #1677 ---- - lib/gs-utils.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/gs-utils.c b/lib/gs-utils.c -index 6dc4d28a0..b8eefe36e 100644 ---- a/lib/gs-utils.c -+++ b/lib/gs-utils.c -@@ -1488,7 +1488,7 @@ gs_utils_get_file_size (const gchar *filename, - return size; - } - --#define METADATA_ETAG_ATTRIBUTE "metadata::etag" -+#define METADATA_ETAG_ATTRIBUTE "xattr::gnome-software::etag" - - /** - * gs_utils_get_file_etag: --- -GitLab - diff --git a/1285.patch b/1285.patch deleted file mode 100644 index 1caae0c..0000000 --- a/1285.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 92da7c98217856785dfea518890fa25acd3a055e Mon Sep 17 00:00:00 2001 -From: Philip Withnall -Date: Thu, 10 Mar 2022 14:25:05 +0000 -Subject: [PATCH] =?UTF-8?q?gs-download-utils:=20Ignore=20cancellation=20er?= - =?UTF-8?q?rors=20when=20there=E2=80=99s=20a=20cache=20hit?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In order to avoid overwriting an existing cache file when the server has -said it’s up to date, we cancel closing the output stream. - -Avoid propagating that cancellation error up to the caller; to them, the -operation should seem like a success rather than returning -`G_IO_ERROR_CANCELLED`. - -Signed-off-by: Philip Withnall - -Fixes: #1679 ---- - lib/gs-download-utils.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/lib/gs-download-utils.c b/lib/gs-download-utils.c -index f3a64479b..4ab15c098 100644 ---- a/lib/gs-download-utils.c -+++ b/lib/gs-download-utils.c -@@ -467,7 +467,13 @@ close_stream_cb (GObject *source_object, - * overwrite errors set earlier in the operation. */ - if (!g_output_stream_close_finish (G_OUTPUT_STREAM (source_object), - result, &local_error)) { -- if (data->error == NULL) -+ /* If we are aborting writing the output stream (perhaps -+ * because of a cache hit), don’t report the error at -+ * all. */ -+ if (data->discard_output_stream && -+ g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ g_clear_error (&local_error); -+ else if (data->error == NULL) - data->error = g_steal_pointer (&local_error); - else if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_debug ("Error closing output stream: %s", local_error->message); --- -GitLab - diff --git a/gnome-software.spec b/gnome-software.spec index d3ac2cb..a650146 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,8 +12,8 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42~rc -Release: 2%{?dist} +Version: 42.0 +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,8 +21,6 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch -Patch02: 1282.patch -Patch03: 1285.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -199,6 +197,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Fri Mar 18 2022 Milan Crha - 42.0-1 +- Update to 42.0 + * Thu Mar 10 2022 Milan Crha - 42.rc-2 - Add upstream patches for gs-download-utils (i#1677 and i#1679) diff --git a/sources b/sources index 6afee80..2a6fbea 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.rc.tar.xz) = cd9c465d73b8998c0ebc49d5e40fec22522e0f125cbce5ff59a7a13d779a3793ac57dfb606d9b918e0c198b6b6cd62657483dc8e83a77ed84966c5f44980f38b +SHA512 (gnome-software-42.0.tar.xz) = f630232d164d1a7adcf9a91133769c6fe4ce62cdaeccd49b991330682eeccfddc8f83c7326802aaabdb4fc537243c0fd19741c702f4d23d75ebd71e9abb3da92 From 3bea79c8292d26f0d87786ee085fc58778d7de17 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 11 Apr 2022 10:31:30 +0200 Subject: [PATCH 08/18] Resolves: #2072661 (Workaround overlapping labels caused by gtk4 bug) --- 0002-app-row-no-multiline.patch | 55 +++++++++++++++++++++++++++++++++ gnome-software.spec | 6 +++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0002-app-row-no-multiline.patch diff --git a/0002-app-row-no-multiline.patch b/0002-app-row-no-multiline.patch new file mode 100644 index 0000000..fd68c59 --- /dev/null +++ b/0002-app-row-no-multiline.patch @@ -0,0 +1,55 @@ +From 5ea824c584e5824637e9e323fd867b9d7d6ec750 Mon Sep 17 00:00:00 2001 +From: Joshua Lee +Date: Sun, 3 Apr 2022 05:14:20 +0100 +Subject: [PATCH] app-row: Ensure labels don't overlap + +Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/4714, +multi-line labels result in app-row displaying overlapping text. +Workaround this issue by restraining offending labels to one +line in addition to disabling wrapping. +--- + src/gs-app-row.ui | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/gs-app-row.ui b/src/gs-app-row.ui +index 75fb2f598..d7a2fc93b 100644 +--- a/src/gs-app-row.ui ++++ b/src/gs-app-row.ui +@@ -34,7 +34,7 @@ + 0.0 + 0.5 + end +- 3 ++ 1 + word-char + +-- +GitLab + diff --git a/gnome-software.spec b/gnome-software.spec index a650146..cbfc978 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -13,7 +13,7 @@ Name: gnome-software Version: 42.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,6 +21,7 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +Patch02: 0002-app-row-no-multiline.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -197,6 +198,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Mon Apr 11 2022 Milan Crha - 42.0-2 +- Resolves: #2072661 (Workaround overlapping labels caused by gtk4 bug) + * Fri Mar 18 2022 Milan Crha - 42.0-1 - Update to 42.0 From 0692f3051711ac88bae433170e70a39eef7ad5d6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 11 Apr 2022 12:38:21 +0200 Subject: [PATCH 09/18] Resolves: #2073353 (RPM repos can't be disabled in GNOME Software after F35->F36 upgrade) --- 0003-provenance-quirks-on-repos.patch | 56 +++++++++++++++++++++++++++ gnome-software.spec | 2 + 2 files changed, 58 insertions(+) create mode 100644 0003-provenance-quirks-on-repos.patch diff --git a/0003-provenance-quirks-on-repos.patch b/0003-provenance-quirks-on-repos.patch new file mode 100644 index 0000000..1d4daa4 --- /dev/null +++ b/0003-provenance-quirks-on-repos.patch @@ -0,0 +1,56 @@ +From ff4bc92c4c3824710cc6259b6bc8ddb71782f918 Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Mon, 11 Apr 2022 12:30:49 +0200 +Subject: [PATCH] gs-plugin-provenance: Handle repositories specifically + +Do not check origin of the repository GsApp instances, because +the compulsory and provenance quirks should not be inherited +from the source. They should be for the repository itself. + +Reported downstream at: +https://bugzilla.redhat.com/show_bug.cgi?id=2073353 +--- + plugins/core/gs-plugin-provenance.c | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/plugins/core/gs-plugin-provenance.c b/plugins/core/gs-plugin-provenance.c +index 2cb442aec..95e940bba 100644 +--- a/plugins/core/gs-plugin-provenance.c ++++ b/plugins/core/gs-plugin-provenance.c +@@ -188,23 +188,23 @@ refine_app (GsPlugin *plugin, + if (gs_app_has_quirk (app, GS_APP_QUIRK_PROVENANCE)) + return TRUE; + +- /* simple case */ +- origin = gs_app_get_origin (app); +- if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, origin, &quirks)) { +- gs_plugin_provenance_add_quirks (app, quirks); +- return TRUE; +- } +- + /* Software sources/repositories are represented as #GsApps too. Add the + * provenance quirk to the system-configured repositories (but not + * user-configured ones). */ +- if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY && +- gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, gs_app_get_id (app), &quirks)) { +- if (gs_app_get_scope (app) != AS_COMPONENT_SCOPE_USER) ++ if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY) { ++ if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, gs_app_get_id (app), &quirks) && ++ gs_app_get_scope (app) != AS_COMPONENT_SCOPE_USER) + gs_plugin_provenance_add_quirks (app, quirks); + return TRUE; + } + ++ /* simple case */ ++ origin = gs_app_get_origin (app); ++ if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, origin, &quirks)) { ++ gs_plugin_provenance_add_quirks (app, quirks); ++ return TRUE; ++ } ++ + /* this only works for packages */ + origin = gs_app_get_source_id_default (app); + if (origin == NULL) +-- +GitLab + diff --git a/gnome-software.spec b/gnome-software.spec index cbfc978..c6c8aec 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -22,6 +22,7 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-app-row-no-multiline.patch +Patch03: 0003-provenance-quirks-on-repos.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -200,6 +201,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %changelog * Mon Apr 11 2022 Milan Crha - 42.0-2 - Resolves: #2072661 (Workaround overlapping labels caused by gtk4 bug) +- Resolves: #2073353 (RPM repos can't be disabled in GNOME Software after F35->F36 upgrade) * Fri Mar 18 2022 Milan Crha - 42.0-1 - Update to 42.0 From 5451b3e5f2a91c6731f376e14245f78804a4404a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 19 Apr 2022 13:04:29 +0200 Subject: [PATCH 10/18] Resolves: #2074121 (Enabling "Fedora Flathub Selection" repo doesn't show included apps) --- 0004-flatpak-filtered-flathub-enable.patch | 155 +++++++++++++++++++++ gnome-software.spec | 6 +- 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 0004-flatpak-filtered-flathub-enable.patch diff --git a/0004-flatpak-filtered-flathub-enable.patch b/0004-flatpak-filtered-flathub-enable.patch new file mode 100644 index 0000000..a9e62eb --- /dev/null +++ b/0004-flatpak-filtered-flathub-enable.patch @@ -0,0 +1,155 @@ +diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c +index b67bc91e..dd528cc2 100644 +--- a/plugins/flatpak/gs-flatpak.c ++++ b/plugins/flatpak/gs-flatpak.c +@@ -451,22 +451,6 @@ static gboolean + gs_flatpak_claim_changed_idle_cb (gpointer user_data) + { + GsFlatpak *self = user_data; +- +- self->requires_full_rescan = TRUE; +- +- gs_plugin_cache_invalidate (self->plugin); +- gs_plugin_reload (self->plugin); +- +- return G_SOURCE_REMOVE; +-} +- +-static void +-gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, +- GFile *child, +- GFile *other_file, +- GFileMonitorEvent event_type, +- GsFlatpak *self) +-{ + g_autoptr(GError) error = NULL; + g_autoptr(GMutexLocker) locker = NULL; + g_autoptr(GRWLockWriterLocker) writer_locker = NULL; +@@ -486,6 +470,21 @@ gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, + xb_silo_invalidate (self->silo); + g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); + ++ self->requires_full_rescan = TRUE; ++ ++ gs_plugin_cache_invalidate (self->plugin); ++ gs_plugin_reload (self->plugin); ++ ++ return G_SOURCE_REMOVE; ++} ++ ++static void ++gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, ++ GFile *child, ++ GFile *other_file, ++ GFileMonitorEvent event_type, ++ GsFlatpak *self) ++{ + if (gs_flatpak_get_busy (self)) { + self->changed_while_busy = TRUE; + } else { +From 4658b2c0ab6b252a3fcde8027178f05954472e4e Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Tue, 12 Apr 2022 13:48:29 +0200 +Subject: flatpak: Cleanup broken_remotes hash when flatpak installation + changed + +When there's notified the flatpak installation changed, it's likely some +of the known broken remotes could have changed as well, thus do not wait +for a plugin refresh() call and cleanup the broken_remotes immediately. + +diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c +index dd528cc2..71d62803 100644 +--- a/plugins/flatpak/gs-flatpak.c ++++ b/plugins/flatpak/gs-flatpak.c +@@ -465,6 +465,11 @@ gs_flatpak_claim_changed_idle_cb (gpointer user_data) + g_hash_table_remove_all (self->remote_title); + g_clear_pointer (&locker, g_mutex_locker_free); + ++ /* give all the repos a second chance */ ++ locker = g_mutex_locker_new (&self->broken_remotes_mutex); ++ g_hash_table_remove_all (self->broken_remotes); ++ g_clear_pointer (&locker, g_mutex_locker_free); ++ + writer_locker = g_rw_lock_writer_locker_new (&self->silo_lock); + if (self->silo) + xb_silo_invalidate (self->silo); +diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c +index 71d62803..df81ea90 100644 +--- a/plugins/flatpak/gs-flatpak.c ++++ b/plugins/flatpak/gs-flatpak.c +@@ -447,11 +447,9 @@ gs_flatpak_create_source (GsFlatpak *self, FlatpakRemote *xremote) + return g_steal_pointer (&app); + } + +-static gboolean +-gs_flatpak_claim_changed_idle_cb (gpointer user_data) ++static void ++gs_flatpak_internal_data_changed (GsFlatpak *self) + { +- GsFlatpak *self = user_data; +- g_autoptr(GError) error = NULL; + g_autoptr(GMutexLocker) locker = NULL; + g_autoptr(GRWLockWriterLocker) writer_locker = NULL; + +@@ -476,7 +474,14 @@ gs_flatpak_claim_changed_idle_cb (gpointer user_data) + g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); + + self->requires_full_rescan = TRUE; ++} + ++static gboolean ++gs_flatpak_claim_changed_idle_cb (gpointer user_data) ++{ ++ GsFlatpak *self = user_data; ++ ++ gs_flatpak_internal_data_changed (self); + gs_plugin_cache_invalidate (self->plugin); + gs_plugin_reload (self->plugin); + +@@ -1086,10 +1091,17 @@ gs_flatpak_rescan_app_data (GsFlatpak *self, + gboolean res = gs_flatpak_refresh (self, 0, interactive, cancellable, error); + if (res) + self->requires_full_rescan = FALSE; ++ else ++ gs_flatpak_internal_data_changed (self); + return res; + } + +- return gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error); ++ if (!gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error)) { ++ gs_flatpak_internal_data_changed (self); ++ return FALSE; ++ } ++ ++ return TRUE; + } + + gboolean +@@ -1956,8 +1968,16 @@ gs_flatpak_refresh (GsFlatpak *self, + g_hash_table_remove_all (self->broken_remotes); + g_mutex_unlock (&self->broken_remotes_mutex); + +- /* manually drop the cache */ +- if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, interactive), ++ /* manually drop the cache in both installation instances; ++ * it's needed to have them both agree on the content. */ ++ if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, FALSE), ++ cancellable, ++ error)) { ++ gs_flatpak_error_convert (error); ++ return FALSE; ++ } ++ ++ if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, TRUE), + cancellable, + error)) { + gs_flatpak_error_convert (error); +@@ -3261,7 +3281,7 @@ gs_flatpak_refine_app_unlocked (GsFlatpak *self, + gs_app_get_unique_id (app), + error_local->message); + } else { +- g_prefix_error (&error_local, "failed to get permissions: "); ++ g_prefix_error (&error_local, "failed to read permissions from app '%s' metadata: ", gs_app_get_unique_id (app)); + g_propagate_error (error, g_steal_pointer (&error_local)); + return FALSE; + } diff --git a/gnome-software.spec b/gnome-software.spec index c6c8aec..3b2cf22 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -13,7 +13,7 @@ Name: gnome-software Version: 42.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -23,6 +23,7 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-app-row-no-multiline.patch Patch03: 0003-provenance-quirks-on-repos.patch +Patch04: 0004-flatpak-filtered-flathub-enable.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -199,6 +200,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Tue Apr 19 2022 Milan Crha - 42.0-3 +- Resolves: #2074121 (Enabling "Fedora Flathub Selection" repo doesn't show included apps) + * Mon Apr 11 2022 Milan Crha - 42.0-2 - Resolves: #2072661 (Workaround overlapping labels caused by gtk4 bug) - Resolves: #2073353 (RPM repos can't be disabled in GNOME Software after F35->F36 upgrade) From ce4cfad61c0ebcb0cfd892ebf794a7b8a429d778 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 20 Apr 2022 17:23:49 +0200 Subject: [PATCH 11/18] Update patch for bug #2074121 --- 0004-flatpak-filtered-flathub-enable.patch | 51 ++++++++++++++++++++++ gnome-software.spec | 5 ++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/0004-flatpak-filtered-flathub-enable.patch b/0004-flatpak-filtered-flathub-enable.patch index a9e62eb..90d81c8 100644 --- a/0004-flatpak-filtered-flathub-enable.patch +++ b/0004-flatpak-filtered-flathub-enable.patch @@ -153,3 +153,54 @@ index 71d62803..df81ea90 100644 g_propagate_error (error, g_steal_pointer (&error_local)); return FALSE; } + +diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c +index df81ea90..09d28add 100644 +--- a/plugins/flatpak/gs-flatpak.c ++++ b/plugins/flatpak/gs-flatpak.c +@@ -1042,6 +1042,10 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self, + if (!gs_flatpak_add_apps_from_xremote (self, builder, xremote, interactive, cancellable, &error_local)) { + g_debug ("Failed to add apps from remote ‘%s’; skipping: %s", + flatpak_remote_get_name (xremote), error_local->message); ++ if (g_cancellable_set_error_if_cancelled (cancellable, error)) { ++ gs_flatpak_error_convert (error); ++ return FALSE; ++ } + } + } + +@@ -1069,7 +1073,7 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self, + self->silo = xb_builder_ensure (builder, file, + XB_BUILDER_COMPILE_FLAG_IGNORE_INVALID | + XB_BUILDER_COMPILE_FLAG_SINGLE_LANG, +- NULL, error); ++ cancellable, error); + + if (old_thread_default != NULL) + g_main_context_push_thread_default (old_thread_default); +@@ -1752,22 +1756,16 @@ gs_flatpak_app_install_source (GsFlatpak *self, + gs_flatpak_error_convert (error); + g_prefix_error (error, "cannot modify remote: "); + gs_app_set_state_recover (app); ++ gs_flatpak_internal_data_changed (self); + return FALSE; + } + +- /* invalidate cache */ +- g_rw_lock_reader_lock (&self->silo_lock); +- if (self->silo != NULL) +- xb_silo_invalidate (self->silo); +- g_rw_lock_reader_unlock (&self->silo_lock); ++ /* Mark the internal cache as obsolete. */ ++ gs_flatpak_internal_data_changed (self); + + /* success */ + gs_app_set_state (app, GS_APP_STATE_INSTALLED); + +- /* This can fail silently, it's only to update necessary caches, to provide +- * up-to-date information after the successful remote enable/install. */ +- gs_flatpak_refresh (self, 1, interactive, cancellable, NULL); +- + gs_plugin_repository_changed (self->plugin, app); + + return TRUE; diff --git a/gnome-software.spec b/gnome-software.spec index 3b2cf22..e5b3f7d 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -13,7 +13,7 @@ Name: gnome-software Version: 42.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -200,6 +200,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Wed Apr 20 2022 Milan Crha - 42.0-4 +- Update patch for bug #2074121 + * Tue Apr 19 2022 Milan Crha - 42.0-3 - Resolves: #2074121 (Enabling "Fedora Flathub Selection" repo doesn't show included apps) From 03479cfce242d651c1a4b2297050e08fe4f42fea Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 27 Apr 2022 09:36:24 +0200 Subject: [PATCH 12/18] Update to 42.1 --- 0002-app-row-no-multiline.patch | 55 ------ 0003-provenance-quirks-on-repos.patch | 56 ------ 0004-flatpak-filtered-flathub-enable.patch | 206 --------------------- gnome-software.spec | 20 +- sources | 2 +- 5 files changed, 11 insertions(+), 328 deletions(-) delete mode 100644 0002-app-row-no-multiline.patch delete mode 100644 0003-provenance-quirks-on-repos.patch delete mode 100644 0004-flatpak-filtered-flathub-enable.patch diff --git a/0002-app-row-no-multiline.patch b/0002-app-row-no-multiline.patch deleted file mode 100644 index fd68c59..0000000 --- a/0002-app-row-no-multiline.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 5ea824c584e5824637e9e323fd867b9d7d6ec750 Mon Sep 17 00:00:00 2001 -From: Joshua Lee -Date: Sun, 3 Apr 2022 05:14:20 +0100 -Subject: [PATCH] app-row: Ensure labels don't overlap - -Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/4714, -multi-line labels result in app-row displaying overlapping text. -Workaround this issue by restraining offending labels to one -line in addition to disabling wrapping. ---- - src/gs-app-row.ui | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/gs-app-row.ui b/src/gs-app-row.ui -index 75fb2f598..d7a2fc93b 100644 ---- a/src/gs-app-row.ui -+++ b/src/gs-app-row.ui -@@ -34,7 +34,7 @@ - 0.0 - 0.5 - end -- 3 -+ 1 - word-char - --- -GitLab - diff --git a/0003-provenance-quirks-on-repos.patch b/0003-provenance-quirks-on-repos.patch deleted file mode 100644 index 1d4daa4..0000000 --- a/0003-provenance-quirks-on-repos.patch +++ /dev/null @@ -1,56 +0,0 @@ -From ff4bc92c4c3824710cc6259b6bc8ddb71782f918 Mon Sep 17 00:00:00 2001 -From: Milan Crha -Date: Mon, 11 Apr 2022 12:30:49 +0200 -Subject: [PATCH] gs-plugin-provenance: Handle repositories specifically - -Do not check origin of the repository GsApp instances, because -the compulsory and provenance quirks should not be inherited -from the source. They should be for the repository itself. - -Reported downstream at: -https://bugzilla.redhat.com/show_bug.cgi?id=2073353 ---- - plugins/core/gs-plugin-provenance.c | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/plugins/core/gs-plugin-provenance.c b/plugins/core/gs-plugin-provenance.c -index 2cb442aec..95e940bba 100644 ---- a/plugins/core/gs-plugin-provenance.c -+++ b/plugins/core/gs-plugin-provenance.c -@@ -188,23 +188,23 @@ refine_app (GsPlugin *plugin, - if (gs_app_has_quirk (app, GS_APP_QUIRK_PROVENANCE)) - return TRUE; - -- /* simple case */ -- origin = gs_app_get_origin (app); -- if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, origin, &quirks)) { -- gs_plugin_provenance_add_quirks (app, quirks); -- return TRUE; -- } -- - /* Software sources/repositories are represented as #GsApps too. Add the - * provenance quirk to the system-configured repositories (but not - * user-configured ones). */ -- if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY && -- gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, gs_app_get_id (app), &quirks)) { -- if (gs_app_get_scope (app) != AS_COMPONENT_SCOPE_USER) -+ if (gs_app_get_kind (app) == AS_COMPONENT_KIND_REPOSITORY) { -+ if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, gs_app_get_id (app), &quirks) && -+ gs_app_get_scope (app) != AS_COMPONENT_SCOPE_USER) - gs_plugin_provenance_add_quirks (app, quirks); - return TRUE; - } - -+ /* simple case */ -+ origin = gs_app_get_origin (app); -+ if (gs_plugin_provenance_find_repo_flags (repos, provenance_wildcards, compulsory_wildcards, origin, &quirks)) { -+ gs_plugin_provenance_add_quirks (app, quirks); -+ return TRUE; -+ } -+ - /* this only works for packages */ - origin = gs_app_get_source_id_default (app); - if (origin == NULL) --- -GitLab - diff --git a/0004-flatpak-filtered-flathub-enable.patch b/0004-flatpak-filtered-flathub-enable.patch deleted file mode 100644 index 90d81c8..0000000 --- a/0004-flatpak-filtered-flathub-enable.patch +++ /dev/null @@ -1,206 +0,0 @@ -diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c -index b67bc91e..dd528cc2 100644 ---- a/plugins/flatpak/gs-flatpak.c -+++ b/plugins/flatpak/gs-flatpak.c -@@ -451,22 +451,6 @@ static gboolean - gs_flatpak_claim_changed_idle_cb (gpointer user_data) - { - GsFlatpak *self = user_data; -- -- self->requires_full_rescan = TRUE; -- -- gs_plugin_cache_invalidate (self->plugin); -- gs_plugin_reload (self->plugin); -- -- return G_SOURCE_REMOVE; --} -- --static void --gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, -- GFile *child, -- GFile *other_file, -- GFileMonitorEvent event_type, -- GsFlatpak *self) --{ - g_autoptr(GError) error = NULL; - g_autoptr(GMutexLocker) locker = NULL; - g_autoptr(GRWLockWriterLocker) writer_locker = NULL; -@@ -486,6 +470,21 @@ gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, - xb_silo_invalidate (self->silo); - g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); - -+ self->requires_full_rescan = TRUE; -+ -+ gs_plugin_cache_invalidate (self->plugin); -+ gs_plugin_reload (self->plugin); -+ -+ return G_SOURCE_REMOVE; -+} -+ -+static void -+gs_plugin_flatpak_changed_cb (GFileMonitor *monitor, -+ GFile *child, -+ GFile *other_file, -+ GFileMonitorEvent event_type, -+ GsFlatpak *self) -+{ - if (gs_flatpak_get_busy (self)) { - self->changed_while_busy = TRUE; - } else { -From 4658b2c0ab6b252a3fcde8027178f05954472e4e Mon Sep 17 00:00:00 2001 -From: Milan Crha -Date: Tue, 12 Apr 2022 13:48:29 +0200 -Subject: flatpak: Cleanup broken_remotes hash when flatpak installation - changed - -When there's notified the flatpak installation changed, it's likely some -of the known broken remotes could have changed as well, thus do not wait -for a plugin refresh() call and cleanup the broken_remotes immediately. - -diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c -index dd528cc2..71d62803 100644 ---- a/plugins/flatpak/gs-flatpak.c -+++ b/plugins/flatpak/gs-flatpak.c -@@ -465,6 +465,11 @@ gs_flatpak_claim_changed_idle_cb (gpointer user_data) - g_hash_table_remove_all (self->remote_title); - g_clear_pointer (&locker, g_mutex_locker_free); - -+ /* give all the repos a second chance */ -+ locker = g_mutex_locker_new (&self->broken_remotes_mutex); -+ g_hash_table_remove_all (self->broken_remotes); -+ g_clear_pointer (&locker, g_mutex_locker_free); -+ - writer_locker = g_rw_lock_writer_locker_new (&self->silo_lock); - if (self->silo) - xb_silo_invalidate (self->silo); -diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c -index 71d62803..df81ea90 100644 ---- a/plugins/flatpak/gs-flatpak.c -+++ b/plugins/flatpak/gs-flatpak.c -@@ -447,11 +447,9 @@ gs_flatpak_create_source (GsFlatpak *self, FlatpakRemote *xremote) - return g_steal_pointer (&app); - } - --static gboolean --gs_flatpak_claim_changed_idle_cb (gpointer user_data) -+static void -+gs_flatpak_internal_data_changed (GsFlatpak *self) - { -- GsFlatpak *self = user_data; -- g_autoptr(GError) error = NULL; - g_autoptr(GMutexLocker) locker = NULL; - g_autoptr(GRWLockWriterLocker) writer_locker = NULL; - -@@ -476,7 +474,14 @@ gs_flatpak_claim_changed_idle_cb (gpointer user_data) - g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); - - self->requires_full_rescan = TRUE; -+} - -+static gboolean -+gs_flatpak_claim_changed_idle_cb (gpointer user_data) -+{ -+ GsFlatpak *self = user_data; -+ -+ gs_flatpak_internal_data_changed (self); - gs_plugin_cache_invalidate (self->plugin); - gs_plugin_reload (self->plugin); - -@@ -1086,10 +1091,17 @@ gs_flatpak_rescan_app_data (GsFlatpak *self, - gboolean res = gs_flatpak_refresh (self, 0, interactive, cancellable, error); - if (res) - self->requires_full_rescan = FALSE; -+ else -+ gs_flatpak_internal_data_changed (self); - return res; - } - -- return gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error); -+ if (!gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error)) { -+ gs_flatpak_internal_data_changed (self); -+ return FALSE; -+ } -+ -+ return TRUE; - } - - gboolean -@@ -1956,8 +1968,16 @@ gs_flatpak_refresh (GsFlatpak *self, - g_hash_table_remove_all (self->broken_remotes); - g_mutex_unlock (&self->broken_remotes_mutex); - -- /* manually drop the cache */ -- if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, interactive), -+ /* manually drop the cache in both installation instances; -+ * it's needed to have them both agree on the content. */ -+ if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, FALSE), -+ cancellable, -+ error)) { -+ gs_flatpak_error_convert (error); -+ return FALSE; -+ } -+ -+ if (!flatpak_installation_drop_caches (gs_flatpak_get_installation (self, TRUE), - cancellable, - error)) { - gs_flatpak_error_convert (error); -@@ -3261,7 +3281,7 @@ gs_flatpak_refine_app_unlocked (GsFlatpak *self, - gs_app_get_unique_id (app), - error_local->message); - } else { -- g_prefix_error (&error_local, "failed to get permissions: "); -+ g_prefix_error (&error_local, "failed to read permissions from app '%s' metadata: ", gs_app_get_unique_id (app)); - g_propagate_error (error, g_steal_pointer (&error_local)); - return FALSE; - } - -diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c -index df81ea90..09d28add 100644 ---- a/plugins/flatpak/gs-flatpak.c -+++ b/plugins/flatpak/gs-flatpak.c -@@ -1042,6 +1042,10 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self, - if (!gs_flatpak_add_apps_from_xremote (self, builder, xremote, interactive, cancellable, &error_local)) { - g_debug ("Failed to add apps from remote ‘%s’; skipping: %s", - flatpak_remote_get_name (xremote), error_local->message); -+ if (g_cancellable_set_error_if_cancelled (cancellable, error)) { -+ gs_flatpak_error_convert (error); -+ return FALSE; -+ } - } - } - -@@ -1069,7 +1073,7 @@ gs_flatpak_rescan_appstream_store (GsFlatpak *self, - self->silo = xb_builder_ensure (builder, file, - XB_BUILDER_COMPILE_FLAG_IGNORE_INVALID | - XB_BUILDER_COMPILE_FLAG_SINGLE_LANG, -- NULL, error); -+ cancellable, error); - - if (old_thread_default != NULL) - g_main_context_push_thread_default (old_thread_default); -@@ -1752,22 +1756,16 @@ gs_flatpak_app_install_source (GsFlatpak *self, - gs_flatpak_error_convert (error); - g_prefix_error (error, "cannot modify remote: "); - gs_app_set_state_recover (app); -+ gs_flatpak_internal_data_changed (self); - return FALSE; - } - -- /* invalidate cache */ -- g_rw_lock_reader_lock (&self->silo_lock); -- if (self->silo != NULL) -- xb_silo_invalidate (self->silo); -- g_rw_lock_reader_unlock (&self->silo_lock); -+ /* Mark the internal cache as obsolete. */ -+ gs_flatpak_internal_data_changed (self); - - /* success */ - gs_app_set_state (app, GS_APP_STATE_INSTALLED); - -- /* This can fail silently, it's only to update necessary caches, to provide -- * up-to-date information after the successful remote enable/install. */ -- gs_flatpak_refresh (self, 1, interactive, cancellable, NULL); -- - gs_plugin_repository_changed (self->plugin, app); - - return TRUE; diff --git a/gnome-software.spec b/gnome-software.spec index e5b3f7d..2b47261 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -9,11 +9,14 @@ %global fwupd_version 1.3.3 %global flatpak_version 1.5.1 +# this is not a library version +%define gs_plugin_version 18 + %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42.0 -Release: 4%{?dist} +Version: 42.1 +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -21,9 +24,6 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch -Patch02: 0002-app-row-no-multiline.patch -Patch03: 0003-provenance-quirks-on-repos.patch -Patch04: 0004-flatpak-filtered-flathub-enable.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -77,9 +77,6 @@ Recommends: PackageKit%{?_isa} >= %{packagekit_version} Obsoletes: gnome-software-snap < 3.33.1 Obsoletes: gnome-software-editor < 3.35.1 -# this is not a library version -%define gs_plugin_version 17 - %description gnome-software is an application that makes it easy to add, remove and update software in the GNOME desktop. @@ -179,8 +176,8 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_repos.so %{_libdir}/gnome-software/plugins-%{gs_plugin_version}/libgs_plugin_rewrite-resource.so %{_sysconfdir}/xdg/autostart/org.gnome.Software.desktop -%{_datadir}/app-info/xmls/org.gnome.Software.Featured.xml -%{_datadir}/app-info/xmls/org.gnome.Software.Popular.xml +%{_datadir}/swcatalog/xml/org.gnome.Software.Featured.xml +%{_datadir}/swcatalog/xml/org.gnome.Software.Popular.xml %{_datadir}/dbus-1/services/org.freedesktop.PackageKit.service %{_datadir}/dbus-1/services/org.gnome.Software.service %{_datadir}/gnome-shell/search-providers/org.gnome.Software-search-provider.ini @@ -200,6 +197,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Wed Apr 27 2022 Milan Crha - 42.1-1 +- Update to 42.1 + * Wed Apr 20 2022 Milan Crha - 42.0-4 - Update patch for bug #2074121 diff --git a/sources b/sources index 2a6fbea..326494a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.0.tar.xz) = f630232d164d1a7adcf9a91133769c6fe4ce62cdaeccd49b991330682eeccfddc8f83c7326802aaabdb4fc537243c0fd19741c702f4d23d75ebd71e9abb3da92 +SHA512 (gnome-software-42.1.tar.xz) = 292a17e94c7409198fdff4250a88cb240a126c3d77a9cfee1ea8608fdc482d75af6f8fc91c5c6c068b474edea6dcb197f88ec09081a8b270d5f3eda67db755ad From d155776a286c9938c8eb0f81cd5b854d4aef8ca4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 30 May 2022 17:53:59 +0200 Subject: [PATCH 13/18] Update to 42.2; Add patch to correct order of the setup of the GsShell; Related: #2056082 (Enable PackageKit autoremove option) --- 0002-shell-setup-order.patch | 134 +++++++++++++++++++++++++++++++++++ gnome-software.spec | 9 ++- sources | 2 +- 3 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 0002-shell-setup-order.patch diff --git a/0002-shell-setup-order.patch b/0002-shell-setup-order.patch new file mode 100644 index 0000000..c0ba76b --- /dev/null +++ b/0002-shell-setup-order.patch @@ -0,0 +1,134 @@ +diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c +index 38cc31bb5..c73adce6d 100644 +--- a/lib/gs-appstream.c ++++ b/lib/gs-appstream.c +@@ -1626,12 +1626,12 @@ gs_appstream_add_categories (XbSilo *silo, + for (guint k = 0; k < groups->len; k++) { + const gchar *group = g_ptr_array_index (groups, k); + guint cnt = gs_appstream_count_component_for_groups (silo, group); +- for (guint l = 0; l < cnt; l++) { +- gs_category_increment_size (parent); ++ if (cnt > 0) { ++ gs_category_increment_size (parent, cnt); + if (children->len > 1) { + /* Parent category has multiple groups, so increment + * each group's size too */ +- gs_category_increment_size (cat); ++ gs_category_increment_size (cat, cnt); + } + } + } +diff --git a/lib/gs-category.c b/lib/gs-category.c +index b311c4941..4baede3bc 100644 +--- a/lib/gs-category.c ++++ b/lib/gs-category.c +@@ -147,17 +147,19 @@ gs_category_set_size (GsCategory *category, guint size) + /** + * gs_category_increment_size: + * @category: a #GsCategory ++ * @value: how many to add + * +- * Adds one to the size count if an application is available ++ * Adds @value to the size count. + * + * Since: 3.22 + **/ + void +-gs_category_increment_size (GsCategory *category) ++gs_category_increment_size (GsCategory *category, ++ guint value) + { + g_return_if_fail (GS_IS_CATEGORY (category)); + +- category->size++; ++ category->size += value; + g_object_notify_by_pspec (G_OBJECT (category), obj_props[PROP_SIZE]); + } + +diff --git a/lib/gs-category.h b/lib/gs-category.h +index ecd2e1e23..1e82591aa 100644 +--- a/lib/gs-category.h ++++ b/lib/gs-category.h +@@ -39,6 +39,7 @@ GsCategory *gs_category_find_child (GsCategory *category, + GPtrArray *gs_category_get_children (GsCategory *category); + + guint gs_category_get_size (GsCategory *category); +-void gs_category_increment_size (GsCategory *category); ++void gs_category_increment_size (GsCategory *category, ++ guint value); + + G_END_DECLS +diff --git a/src/gs-shell.c b/src/gs-shell.c +index db449a9b0..796d7b05a 100644 +--- a/src/gs-shell.c ++++ b/src/gs-shell.c +@@ -107,6 +107,7 @@ struct _GsShell + GtkWidget *primary_menu; + GtkWidget *sub_page_header_title; + ++ gboolean active_after_setup; + gboolean is_narrow; + guint allocation_changed_cb_id; + +@@ -165,6 +166,12 @@ gs_shell_modal_dialog_present (GsShell *shell, GtkWindow *window) + void + gs_shell_activate (GsShell *shell) + { ++ /* Waiting for plugin loader to setup first */ ++ if (shell->plugin_loader == NULL) { ++ shell->active_after_setup = TRUE; ++ return; ++ } ++ + gtk_widget_show (GTK_WIDGET (shell)); + gtk_window_present (GTK_WINDOW (shell)); + } +@@ -2237,6 +2244,11 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can + if (g_settings_get_boolean (shell->settings, "first-run")) + g_settings_set_boolean (shell->settings, "first-run", FALSE); + } ++ ++ if (shell->active_after_setup) { ++ shell->active_after_setup = FALSE; ++ gs_shell_activate (shell); ++ } + } + + void +diff --git a/src/gs-application.c b/src/gs-application.c +index e3f5f55c7..bdadd5c34 100644 +--- a/src/gs-application.c ++++ b/src/gs-application.c +@@ -968,12 +968,9 @@ gs_application_startup (GApplication *application) + G_CALLBACK (gs_application_shell_loaded_cb), + app); + +- gs_shell_setup (app->shell, app->plugin_loader, app->cancellable); + app->main_window = GTK_WINDOW (app->shell); + gtk_application_add_window (GTK_APPLICATION (app), app->main_window); + +- app->update_monitor = gs_update_monitor_new (app, app->plugin_loader); +- + gs_application_update_software_sources_presence (application); + + /* Set up the plugins. */ +@@ -990,6 +987,7 @@ startup_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) + { ++ GsApplication *app = GS_APPLICATION (user_data); + GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object); + g_autoptr(GError) local_error = NULL; + +@@ -1002,6 +1000,11 @@ startup_cb (GObject *source_object, + + /* show the priority of each plugin */ + gs_plugin_loader_dump_state (plugin_loader); ++ ++ /* Setup the shell only after the plugin loader finished its setup, ++ thus all plugins are loaded and ready for the jobs. */ ++ gs_shell_setup (app->shell, app->plugin_loader, app->cancellable); ++ app->update_monitor = gs_update_monitor_new (app, app->plugin_loader); + } + + static void diff --git a/gnome-software.spec b/gnome-software.spec index 2b47261..6a48ea0 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -15,7 +15,7 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42.1 +Version: 42.2 Release: 1%{?dist} Summary: A software center for GNOME @@ -24,6 +24,7 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +Patch02: 0002-shell-setup-order.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -111,6 +112,7 @@ This package includes the rpm-ostree backend. -Dmalcontent=true \ -Dgudev=true \ -Dpackagekit=true \ + -Dpackagekit_autoremove=true \ -Dexternal_appstream=false \ -Drpm_ostree=true \ -Dtests=false @@ -197,6 +199,11 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Mon May 30 2022 Milan Crha - 42.2-1 +- Update to 42.2 +- Add patch to correct order of the setup of the GsShell +- Related: #2056082 (Enable PackageKit autoremove option) + * Wed Apr 27 2022 Milan Crha - 42.1-1 - Update to 42.1 diff --git a/sources b/sources index 326494a..fc682d9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.1.tar.xz) = 292a17e94c7409198fdff4250a88cb240a126c3d77a9cfee1ea8608fdc482d75af6f8fc91c5c6c068b474edea6dcb197f88ec09081a8b270d5f3eda67db755ad +SHA512 (gnome-software-42.2.tar.xz) = 2b231afbedb241b8957fa902c37cd85734cdb8b2071cd32ac75ae2e9e064483fe1e9e8d49f2e6df478fdd01e9c6225a85887ba2af1792a9150b89cea75ef8bb4 From 12bf40ffd463ece4f34c72f15a03011381b692f0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 13 Jun 2022 14:43:28 +0200 Subject: [PATCH 14/18] Add patch for crash under gs_flatpak_refine_app_unlocked() --- ...under-gs-flatpak-refine-app-unlocked.patch | 386 ++++++++++++++++++ gnome-software.spec | 6 +- 2 files changed, 391 insertions(+), 1 deletion(-) create mode 100644 0003-crash-under-gs-flatpak-refine-app-unlocked.patch diff --git a/0003-crash-under-gs-flatpak-refine-app-unlocked.patch b/0003-crash-under-gs-flatpak-refine-app-unlocked.patch new file mode 100644 index 0000000..701e7ef --- /dev/null +++ b/0003-crash-under-gs-flatpak-refine-app-unlocked.patch @@ -0,0 +1,386 @@ +diff -up gnome-software-42.2/lib/gs-appstream.c.3 gnome-software-42.2/lib/gs-appstream.c +--- gnome-software-42.2/lib/gs-appstream.c.3 2022-06-13 14:34:05.477145977 +0200 ++++ gnome-software-42.2/lib/gs-appstream.c 2022-06-13 14:36:26.640218337 +0200 +@@ -20,7 +20,13 @@ GsApp * + gs_appstream_create_app (GsPlugin *plugin, XbSilo *silo, XbNode *component, GError **error) + { + GsApp *app; +- g_autoptr(GsApp) app_new = gs_app_new (NULL); ++ g_autoptr(GsApp) app_new = NULL; ++ ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), NULL); ++ g_return_val_if_fail (XB_IS_SILO (silo), NULL); ++ g_return_val_if_fail (XB_IS_NODE (component), NULL); ++ ++ app_new = gs_app_new (NULL); + + /* refine enough to get the unique ID */ + if (!gs_appstream_refine_app (plugin, app_new, silo, component, +@@ -967,6 +973,11 @@ gs_appstream_refine_app (GsPlugin *plugi + g_autoptr(GPtrArray) launchables = NULL; + g_autoptr(XbNode) req = NULL; + ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); ++ g_return_val_if_fail (GS_IS_APP (app), FALSE); ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (XB_IS_NODE (component), FALSE); ++ + /* is compatible */ + req = xb_node_query_first (component, + "requires/id[@type='id']" +@@ -1411,6 +1422,11 @@ gs_appstream_search (GsPlugin *plugin, + { AS_SEARCH_TOKEN_MATCH_NONE, NULL } + }; + ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (values != NULL, FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + /* add some weighted queries */ + for (guint i = 0; queries[i].xpath != NULL; i++) { + g_autoptr(GError) error_query = NULL; +@@ -1487,6 +1503,11 @@ gs_appstream_add_category_apps (GsPlugin + { + GPtrArray *desktop_groups; + ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_CATEGORY (category), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + desktop_groups = gs_category_get_desktop_groups (category); + if (desktop_groups->len == 0) { + g_warning ("no desktop_groups for %s", gs_category_get_id (category)); +@@ -1577,6 +1598,9 @@ gs_appstream_add_categories (XbSilo *sil + GCancellable *cancellable, + GError **error) + { ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (list != NULL, FALSE); ++ + for (guint j = 0; j < list->len; j++) { + GsCategory *parent = GS_CATEGORY (g_ptr_array_index (list, j)); + GPtrArray *children = gs_category_get_children (parent); +@@ -1611,6 +1635,9 @@ gs_appstream_add_popular (XbSilo *silo, + g_autoptr(GError) error_local = NULL; + g_autoptr(GPtrArray) array = NULL; + ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + /* find out how many packages are in each category */ + array = xb_silo_query (silo, + "components/component/kudos/" +@@ -1648,6 +1675,10 @@ gs_appstream_add_recent (GsPlugin *plugi + g_autoptr(GError) error_local = NULL; + g_autoptr(GPtrArray) array = NULL; + ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + /* use predicate conditions to the max */ + xpath = g_strdup_printf ("components/component/releases/" + "release[@timestamp>%" G_GUINT64_FORMAT "]/../..", +@@ -1686,6 +1717,10 @@ gs_appstream_add_alternates (XbSilo *sil + g_autoptr(GPtrArray) ids = NULL; + g_autoptr(GString) xpath = g_string_new (NULL); + ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_APP (app), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + /* probably a package we know nothing about */ + if (gs_app_get_id (app) == NULL) + return TRUE; +@@ -1743,6 +1778,9 @@ gs_appstream_add_featured (XbSilo *silo, + g_autoptr(GError) error_local = NULL; + g_autoptr(GPtrArray) array = NULL; + ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ + /* find out how many packages are in each category */ + array = xb_silo_query (silo, + "components/component/custom/value[@key='GnomeSoftware::FeatureTile']/../..|" +@@ -1782,6 +1820,11 @@ gs_appstream_url_to_app (GsPlugin *plugi + g_autofree gchar *xpath = NULL; + g_autoptr(GPtrArray) components = NULL; + ++ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); ++ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); ++ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); ++ g_return_val_if_fail (url != NULL, FALSE); ++ + /* not us */ + scheme = gs_utils_get_url_scheme (url); + if (g_strcmp0 (scheme, "appstream") != 0) +@@ -1812,6 +1855,9 @@ gs_appstream_component_add_keyword (XbBu + g_autoptr(XbBuilderNode) keyword = NULL; + g_autoptr(XbBuilderNode) keywords = NULL; + ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ g_return_if_fail (str != NULL); ++ + /* create if it does not already exist */ + keywords = xb_builder_node_get_child (component, "keywords", NULL); + if (keywords == NULL) +@@ -1831,6 +1877,9 @@ gs_appstream_component_add_provide (XbBu + g_autoptr(XbBuilderNode) provide = NULL; + g_autoptr(XbBuilderNode) provides = NULL; + ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ g_return_if_fail (str != NULL); ++ + /* create if it does not already exist */ + provides = xb_builder_node_get_child (component, "provides", NULL); + if (provides == NULL) +@@ -1850,6 +1899,9 @@ gs_appstream_component_add_category (XbB + g_autoptr(XbBuilderNode) category = NULL; + g_autoptr(XbBuilderNode) categories = NULL; + ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ g_return_if_fail (str != NULL); ++ + /* create if it does not already exist */ + categories = xb_builder_node_get_child (component, "categories", NULL); + if (categories == NULL) +@@ -1868,6 +1920,9 @@ gs_appstream_component_add_icon (XbBuild + { + g_autoptr(XbBuilderNode) icon = NULL; + ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ g_return_if_fail (str != NULL); ++ + /* create str if it does not already exist */ + icon = xb_builder_node_get_child (component, "icon", NULL); + if (icon == NULL) { +@@ -1881,7 +1936,11 @@ gs_appstream_component_add_icon (XbBuild + void + gs_appstream_component_add_extra_info (XbBuilderNode *component) + { +- const gchar *kind = xb_builder_node_get_attr (component, "type"); ++ const gchar *kind; ++ ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ ++ kind = xb_builder_node_get_attr (component, "type"); + + /* add the gnome-software-specific 'Addon' group and ensure they + * all have an icon set */ +@@ -1927,9 +1986,14 @@ gs_appstream_component_add_extra_info (X + void + gs_appstream_component_fix_url (XbBuilderNode *component, const gchar *baseurl) + { +- const gchar *text = xb_builder_node_get_text (component); ++ const gchar *text; + g_autofree gchar *url = NULL; + ++ g_return_if_fail (XB_IS_BUILDER_NODE (component)); ++ g_return_if_fail (baseurl != NULL); ++ ++ text = xb_builder_node_get_text (component); ++ + if (text == NULL) + return; + +diff -up gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 gnome-software-42.2/plugins/flatpak/gs-flatpak.c +--- gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 2022-05-30 13:43:00.000000000 +0200 ++++ gnome-software-42.2/plugins/flatpak/gs-flatpak.c 2022-06-13 14:34:05.480145978 +0200 +@@ -467,10 +467,18 @@ gs_flatpak_create_source (GsFlatpak *sel + } + + static void ++gs_flatpak_invalidate_silo (GsFlatpak *self) ++{ ++ g_rw_lock_writer_lock (&self->silo_lock); ++ if (self->silo != NULL) ++ xb_silo_invalidate (self->silo); ++ g_rw_lock_writer_unlock (&self->silo_lock); ++} ++ ++static void + gs_flatpak_internal_data_changed (GsFlatpak *self) + { + g_autoptr(GMutexLocker) locker = NULL; +- g_autoptr(GRWLockWriterLocker) writer_locker = NULL; + + /* drop the installed refs cache */ + locker = g_mutex_locker_new (&self->installed_refs_mutex); +@@ -487,10 +495,7 @@ gs_flatpak_internal_data_changed (GsFlat + g_hash_table_remove_all (self->broken_remotes); + g_clear_pointer (&locker, g_mutex_locker_free); + +- writer_locker = g_rw_lock_writer_locker_new (&self->silo_lock); +- if (self->silo) +- xb_silo_invalidate (self->silo); +- g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); ++ gs_flatpak_invalidate_silo (self); + + self->requires_full_rescan = TRUE; + } +@@ -2009,10 +2014,7 @@ gs_flatpak_refresh (GsFlatpak *self, + g_mutex_unlock (&self->installed_refs_mutex); + + /* manually do this in case we created the first appstream file */ +- g_rw_lock_reader_lock (&self->silo_lock); +- if (self->silo != NULL) +- xb_silo_invalidate (self->silo); +- g_rw_lock_reader_unlock (&self->silo_lock); ++ gs_flatpak_invalidate_silo (self); + + /* update AppStream metadata */ + if (!gs_flatpak_refresh_appstream (self, cache_age_secs, interactive, cancellable, error)) +@@ -3197,6 +3199,20 @@ gs_flatpak_refine_app_unlocked (GsFlatpa + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); + ++ if (self->silo == NULL) { ++ g_clear_pointer (&locker, g_rw_lock_reader_locker_free); ++ if (!gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error)) ++ return FALSE; ++ ++ locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } ++ } ++ + /* always do AppStream properties */ + if (!gs_flatpak_refine_appstream (self, app, self->silo, flags, interactive, cancellable, error)) + return FALSE; +@@ -3394,6 +3410,13 @@ gs_flatpak_refine_wildcard (GsFlatpak *s + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); + ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } ++ + /* find all apps when matching any prefixes */ + xpath = g_strdup_printf ("components/component/id[text()='%s']/..", id); + components = xb_silo_query (self->silo, xpath, 0, &error_local); +@@ -3487,10 +3510,7 @@ gs_flatpak_app_remove_source (GsFlatpak + } + + /* invalidate cache */ +- g_rw_lock_reader_lock (&self->silo_lock); +- if (self->silo != NULL) +- xb_silo_invalidate (self->silo); +- g_rw_lock_reader_unlock (&self->silo_lock); ++ gs_flatpak_invalidate_silo (self); + + gs_app_set_state (app, is_remove ? GS_APP_STATE_UNAVAILABLE : GS_APP_STATE_AVAILABLE); + +@@ -3953,6 +3973,13 @@ gs_flatpak_search (GsFlatpak *self, + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } ++ + if (!gs_appstream_search (self->plugin, self->silo, values, list_tmp, + cancellable, error)) + return FALSE; +@@ -4022,6 +4049,12 @@ gs_flatpak_add_category_apps (GsFlatpak + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + return gs_appstream_add_category_apps (self->plugin, self->silo, + category, list, + cancellable, error); +@@ -4040,6 +4073,12 @@ gs_flatpak_add_categories (GsFlatpak *se + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + return gs_appstream_add_categories (self->silo, + list, cancellable, error); + } +@@ -4058,6 +4097,12 @@ gs_flatpak_add_popular (GsFlatpak *self, + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + if (!gs_appstream_add_popular (self->silo, list_tmp, + cancellable, error)) + return FALSE; +@@ -4081,6 +4126,12 @@ gs_flatpak_add_featured (GsFlatpak *self + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + if (!gs_appstream_add_featured (self->silo, list_tmp, + cancellable, error)) + return FALSE; +@@ -4105,6 +4156,12 @@ gs_flatpak_add_alternates (GsFlatpak *se + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + if (!gs_appstream_add_alternates (self->silo, app, list_tmp, + cancellable, error)) + return FALSE; +@@ -4129,6 +4186,12 @@ gs_flatpak_add_recent (GsFlatpak *self, + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + if (!gs_appstream_add_recent (self->plugin, self->silo, list_tmp, age, + cancellable, error)) + return FALSE; +@@ -4154,6 +4217,12 @@ gs_flatpak_url_to_app (GsFlatpak *self, + return FALSE; + + locker = g_rw_lock_reader_locker_new (&self->silo_lock); ++ if (self->silo == NULL) { ++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "failed to setup XbSilo for '%s'", ++ gs_flatpak_get_id (self)); ++ return FALSE; ++ } + if (!gs_appstream_url_to_app (self->plugin, self->silo, list_tmp, url, cancellable, error)) + return FALSE; + diff --git a/gnome-software.spec b/gnome-software.spec index 6a48ea0..bf739c7 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -16,7 +16,7 @@ Name: gnome-software Version: 42.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -25,6 +25,7 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-shell-setup-order.patch +Patch03: 0003-crash-under-gs-flatpak-refine-app-unlocked.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -199,6 +200,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Mon Jun 13 2022 Milan Crha - 42.2-2 +- Add patch for crash under gs_flatpak_refine_app_unlocked() + * Mon May 30 2022 Milan Crha - 42.2-1 - Update to 42.2 - Add patch to correct order of the setup of the GsShell From 743d8dfcf13390d96f0f94c499985e57a9e08b23 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 17 Jun 2022 13:08:37 +0100 Subject: [PATCH 15/18] Add patch to make fwupd user requests work --- 0018-fwupd-Fix-the-user-action-dialogs.patch | 46 ++++++++++++++++++++ gnome-software.spec | 6 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0018-fwupd-Fix-the-user-action-dialogs.patch diff --git a/0018-fwupd-Fix-the-user-action-dialogs.patch b/0018-fwupd-Fix-the-user-action-dialogs.patch new file mode 100644 index 0000000..e45e21e --- /dev/null +++ b/0018-fwupd-Fix-the-user-action-dialogs.patch @@ -0,0 +1,46 @@ +From 9aba963f2274e929658b632d6f6ce9c73ee83156 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Tue, 14 Jun 2022 13:04:31 +0100 +Subject: [PATCH 18/18] fwupd: Fix the user action dialogs + +When gnome-software was ported from appstream-glib to libappstream we +missed that the locale arguments are now swapped -- i.e. the former +specified "locale, value" and the latter specified "value, locale". + +This fixes installing software on any devices that require some kind of +user-prompting to complete the update, e.g. buttons that need pressing +or cables that need replugging. +--- + plugins/fwupd/gs-fwupd-app.c | 2 +- + plugins/fwupd/gs-plugin-fwupd.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c +index 03103a3e9..7fcbdadab 100644 +--- a/plugins/fwupd/gs-fwupd-app.c ++++ b/plugins/fwupd/gs-fwupd-app.c +@@ -283,7 +283,7 @@ gs_fwupd_app_set_from_release (GsApp *app, FwupdRelease *rel) + as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT); + as_screenshot_add_image (ss, im); + if (fwupd_release_get_detach_caption (rel) != NULL) +- as_screenshot_set_caption (ss, NULL, fwupd_release_get_detach_caption (rel)); ++ as_screenshot_set_caption (ss, fwupd_release_get_detach_caption (rel), NULL); + gs_app_set_action_screenshot (app, ss); + } + } +diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c +index cac6a324a..3171eb96d 100644 +--- a/plugins/fwupd/gs-plugin-fwupd.c ++++ b/plugins/fwupd/gs-plugin-fwupd.c +@@ -945,7 +945,7 @@ gs_plugin_fwupd_install (GsPluginFwupd *self, + + /* caption is required */ + as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT); +- as_screenshot_set_caption (ss, NULL, fwupd_device_get_update_message (dev)); ++ as_screenshot_set_caption (ss, fwupd_device_get_update_message (dev), NULL); + gs_app_set_action_screenshot (app, ss); + + /* require the dialog */ +-- +2.36.1 + diff --git a/gnome-software.spec b/gnome-software.spec index bf739c7..2714eaf 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -16,7 +16,7 @@ Name: gnome-software Version: 42.2 -Release: 2%{?dist} +Release: 4%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -26,6 +26,7 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-shell-setup-order.patch Patch03: 0003-crash-under-gs-flatpak-refine-app-unlocked.patch +Patch04: 0018-fwupd-Fix-the-user-action-dialogs.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -200,6 +201,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Fri Jun 17 2022 Richard Hughes - 42.2-4 +- Add patch to make fwupd user requests work + * Mon Jun 13 2022 Milan Crha - 42.2-2 - Add patch for crash under gs_flatpak_refine_app_unlocked() From 67f34b01da5ae889ba168ee1dfee36ed433bf24a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 1 Jul 2022 12:08:45 +0200 Subject: [PATCH 16/18] Update to 42.3 --- ...under-gs-flatpak-refine-app-unlocked.patch | 386 ------------------ 0018-fwupd-Fix-the-user-action-dialogs.patch | 46 --- gnome-software.spec | 9 +- sources | 2 +- 4 files changed, 6 insertions(+), 437 deletions(-) delete mode 100644 0003-crash-under-gs-flatpak-refine-app-unlocked.patch delete mode 100644 0018-fwupd-Fix-the-user-action-dialogs.patch diff --git a/0003-crash-under-gs-flatpak-refine-app-unlocked.patch b/0003-crash-under-gs-flatpak-refine-app-unlocked.patch deleted file mode 100644 index 701e7ef..0000000 --- a/0003-crash-under-gs-flatpak-refine-app-unlocked.patch +++ /dev/null @@ -1,386 +0,0 @@ -diff -up gnome-software-42.2/lib/gs-appstream.c.3 gnome-software-42.2/lib/gs-appstream.c ---- gnome-software-42.2/lib/gs-appstream.c.3 2022-06-13 14:34:05.477145977 +0200 -+++ gnome-software-42.2/lib/gs-appstream.c 2022-06-13 14:36:26.640218337 +0200 -@@ -20,7 +20,13 @@ GsApp * - gs_appstream_create_app (GsPlugin *plugin, XbSilo *silo, XbNode *component, GError **error) - { - GsApp *app; -- g_autoptr(GsApp) app_new = gs_app_new (NULL); -+ g_autoptr(GsApp) app_new = NULL; -+ -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), NULL); -+ g_return_val_if_fail (XB_IS_SILO (silo), NULL); -+ g_return_val_if_fail (XB_IS_NODE (component), NULL); -+ -+ app_new = gs_app_new (NULL); - - /* refine enough to get the unique ID */ - if (!gs_appstream_refine_app (plugin, app_new, silo, component, -@@ -967,6 +973,11 @@ gs_appstream_refine_app (GsPlugin *plugi - g_autoptr(GPtrArray) launchables = NULL; - g_autoptr(XbNode) req = NULL; - -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); -+ g_return_val_if_fail (GS_IS_APP (app), FALSE); -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (XB_IS_NODE (component), FALSE); -+ - /* is compatible */ - req = xb_node_query_first (component, - "requires/id[@type='id']" -@@ -1411,6 +1422,11 @@ gs_appstream_search (GsPlugin *plugin, - { AS_SEARCH_TOKEN_MATCH_NONE, NULL } - }; - -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (values != NULL, FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - /* add some weighted queries */ - for (guint i = 0; queries[i].xpath != NULL; i++) { - g_autoptr(GError) error_query = NULL; -@@ -1487,6 +1503,11 @@ gs_appstream_add_category_apps (GsPlugin - { - GPtrArray *desktop_groups; - -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_CATEGORY (category), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - desktop_groups = gs_category_get_desktop_groups (category); - if (desktop_groups->len == 0) { - g_warning ("no desktop_groups for %s", gs_category_get_id (category)); -@@ -1577,6 +1598,9 @@ gs_appstream_add_categories (XbSilo *sil - GCancellable *cancellable, - GError **error) - { -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (list != NULL, FALSE); -+ - for (guint j = 0; j < list->len; j++) { - GsCategory *parent = GS_CATEGORY (g_ptr_array_index (list, j)); - GPtrArray *children = gs_category_get_children (parent); -@@ -1611,6 +1635,9 @@ gs_appstream_add_popular (XbSilo *silo, - g_autoptr(GError) error_local = NULL; - g_autoptr(GPtrArray) array = NULL; - -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - /* find out how many packages are in each category */ - array = xb_silo_query (silo, - "components/component/kudos/" -@@ -1648,6 +1675,10 @@ gs_appstream_add_recent (GsPlugin *plugi - g_autoptr(GError) error_local = NULL; - g_autoptr(GPtrArray) array = NULL; - -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - /* use predicate conditions to the max */ - xpath = g_strdup_printf ("components/component/releases/" - "release[@timestamp>%" G_GUINT64_FORMAT "]/../..", -@@ -1686,6 +1717,10 @@ gs_appstream_add_alternates (XbSilo *sil - g_autoptr(GPtrArray) ids = NULL; - g_autoptr(GString) xpath = g_string_new (NULL); - -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_APP (app), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - /* probably a package we know nothing about */ - if (gs_app_get_id (app) == NULL) - return TRUE; -@@ -1743,6 +1778,9 @@ gs_appstream_add_featured (XbSilo *silo, - g_autoptr(GError) error_local = NULL; - g_autoptr(GPtrArray) array = NULL; - -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ - /* find out how many packages are in each category */ - array = xb_silo_query (silo, - "components/component/custom/value[@key='GnomeSoftware::FeatureTile']/../..|" -@@ -1782,6 +1820,11 @@ gs_appstream_url_to_app (GsPlugin *plugi - g_autofree gchar *xpath = NULL; - g_autoptr(GPtrArray) components = NULL; - -+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE); -+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE); -+ g_return_val_if_fail (GS_IS_APP_LIST (list), FALSE); -+ g_return_val_if_fail (url != NULL, FALSE); -+ - /* not us */ - scheme = gs_utils_get_url_scheme (url); - if (g_strcmp0 (scheme, "appstream") != 0) -@@ -1812,6 +1855,9 @@ gs_appstream_component_add_keyword (XbBu - g_autoptr(XbBuilderNode) keyword = NULL; - g_autoptr(XbBuilderNode) keywords = NULL; - -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ g_return_if_fail (str != NULL); -+ - /* create if it does not already exist */ - keywords = xb_builder_node_get_child (component, "keywords", NULL); - if (keywords == NULL) -@@ -1831,6 +1877,9 @@ gs_appstream_component_add_provide (XbBu - g_autoptr(XbBuilderNode) provide = NULL; - g_autoptr(XbBuilderNode) provides = NULL; - -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ g_return_if_fail (str != NULL); -+ - /* create if it does not already exist */ - provides = xb_builder_node_get_child (component, "provides", NULL); - if (provides == NULL) -@@ -1850,6 +1899,9 @@ gs_appstream_component_add_category (XbB - g_autoptr(XbBuilderNode) category = NULL; - g_autoptr(XbBuilderNode) categories = NULL; - -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ g_return_if_fail (str != NULL); -+ - /* create if it does not already exist */ - categories = xb_builder_node_get_child (component, "categories", NULL); - if (categories == NULL) -@@ -1868,6 +1920,9 @@ gs_appstream_component_add_icon (XbBuild - { - g_autoptr(XbBuilderNode) icon = NULL; - -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ g_return_if_fail (str != NULL); -+ - /* create str if it does not already exist */ - icon = xb_builder_node_get_child (component, "icon", NULL); - if (icon == NULL) { -@@ -1881,7 +1936,11 @@ gs_appstream_component_add_icon (XbBuild - void - gs_appstream_component_add_extra_info (XbBuilderNode *component) - { -- const gchar *kind = xb_builder_node_get_attr (component, "type"); -+ const gchar *kind; -+ -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ -+ kind = xb_builder_node_get_attr (component, "type"); - - /* add the gnome-software-specific 'Addon' group and ensure they - * all have an icon set */ -@@ -1927,9 +1986,14 @@ gs_appstream_component_add_extra_info (X - void - gs_appstream_component_fix_url (XbBuilderNode *component, const gchar *baseurl) - { -- const gchar *text = xb_builder_node_get_text (component); -+ const gchar *text; - g_autofree gchar *url = NULL; - -+ g_return_if_fail (XB_IS_BUILDER_NODE (component)); -+ g_return_if_fail (baseurl != NULL); -+ -+ text = xb_builder_node_get_text (component); -+ - if (text == NULL) - return; - -diff -up gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 gnome-software-42.2/plugins/flatpak/gs-flatpak.c ---- gnome-software-42.2/plugins/flatpak/gs-flatpak.c.3 2022-05-30 13:43:00.000000000 +0200 -+++ gnome-software-42.2/plugins/flatpak/gs-flatpak.c 2022-06-13 14:34:05.480145978 +0200 -@@ -467,10 +467,18 @@ gs_flatpak_create_source (GsFlatpak *sel - } - - static void -+gs_flatpak_invalidate_silo (GsFlatpak *self) -+{ -+ g_rw_lock_writer_lock (&self->silo_lock); -+ if (self->silo != NULL) -+ xb_silo_invalidate (self->silo); -+ g_rw_lock_writer_unlock (&self->silo_lock); -+} -+ -+static void - gs_flatpak_internal_data_changed (GsFlatpak *self) - { - g_autoptr(GMutexLocker) locker = NULL; -- g_autoptr(GRWLockWriterLocker) writer_locker = NULL; - - /* drop the installed refs cache */ - locker = g_mutex_locker_new (&self->installed_refs_mutex); -@@ -487,10 +495,7 @@ gs_flatpak_internal_data_changed (GsFlat - g_hash_table_remove_all (self->broken_remotes); - g_clear_pointer (&locker, g_mutex_locker_free); - -- writer_locker = g_rw_lock_writer_locker_new (&self->silo_lock); -- if (self->silo) -- xb_silo_invalidate (self->silo); -- g_clear_pointer (&writer_locker, g_rw_lock_writer_locker_free); -+ gs_flatpak_invalidate_silo (self); - - self->requires_full_rescan = TRUE; - } -@@ -2009,10 +2014,7 @@ gs_flatpak_refresh (GsFlatpak *self, - g_mutex_unlock (&self->installed_refs_mutex); - - /* manually do this in case we created the first appstream file */ -- g_rw_lock_reader_lock (&self->silo_lock); -- if (self->silo != NULL) -- xb_silo_invalidate (self->silo); -- g_rw_lock_reader_unlock (&self->silo_lock); -+ gs_flatpak_invalidate_silo (self); - - /* update AppStream metadata */ - if (!gs_flatpak_refresh_appstream (self, cache_age_secs, interactive, cancellable, error)) -@@ -3197,6 +3199,20 @@ gs_flatpak_refine_app_unlocked (GsFlatpa - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); - -+ if (self->silo == NULL) { -+ g_clear_pointer (&locker, g_rw_lock_reader_locker_free); -+ if (!gs_flatpak_rescan_appstream_store (self, interactive, cancellable, error)) -+ return FALSE; -+ -+ locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } -+ } -+ - /* always do AppStream properties */ - if (!gs_flatpak_refine_appstream (self, app, self->silo, flags, interactive, cancellable, error)) - return FALSE; -@@ -3394,6 +3410,13 @@ gs_flatpak_refine_wildcard (GsFlatpak *s - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); - -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } -+ - /* find all apps when matching any prefixes */ - xpath = g_strdup_printf ("components/component/id[text()='%s']/..", id); - components = xb_silo_query (self->silo, xpath, 0, &error_local); -@@ -3487,10 +3510,7 @@ gs_flatpak_app_remove_source (GsFlatpak - } - - /* invalidate cache */ -- g_rw_lock_reader_lock (&self->silo_lock); -- if (self->silo != NULL) -- xb_silo_invalidate (self->silo); -- g_rw_lock_reader_unlock (&self->silo_lock); -+ gs_flatpak_invalidate_silo (self); - - gs_app_set_state (app, is_remove ? GS_APP_STATE_UNAVAILABLE : GS_APP_STATE_AVAILABLE); - -@@ -3953,6 +3973,13 @@ gs_flatpak_search (GsFlatpak *self, - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } -+ - if (!gs_appstream_search (self->plugin, self->silo, values, list_tmp, - cancellable, error)) - return FALSE; -@@ -4022,6 +4049,12 @@ gs_flatpak_add_category_apps (GsFlatpak - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - return gs_appstream_add_category_apps (self->plugin, self->silo, - category, list, - cancellable, error); -@@ -4040,6 +4073,12 @@ gs_flatpak_add_categories (GsFlatpak *se - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - return gs_appstream_add_categories (self->silo, - list, cancellable, error); - } -@@ -4058,6 +4097,12 @@ gs_flatpak_add_popular (GsFlatpak *self, - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - if (!gs_appstream_add_popular (self->silo, list_tmp, - cancellable, error)) - return FALSE; -@@ -4081,6 +4126,12 @@ gs_flatpak_add_featured (GsFlatpak *self - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - if (!gs_appstream_add_featured (self->silo, list_tmp, - cancellable, error)) - return FALSE; -@@ -4105,6 +4156,12 @@ gs_flatpak_add_alternates (GsFlatpak *se - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - if (!gs_appstream_add_alternates (self->silo, app, list_tmp, - cancellable, error)) - return FALSE; -@@ -4129,6 +4186,12 @@ gs_flatpak_add_recent (GsFlatpak *self, - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - if (!gs_appstream_add_recent (self->plugin, self->silo, list_tmp, age, - cancellable, error)) - return FALSE; -@@ -4154,6 +4217,12 @@ gs_flatpak_url_to_app (GsFlatpak *self, - return FALSE; - - locker = g_rw_lock_reader_locker_new (&self->silo_lock); -+ if (self->silo == NULL) { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "failed to setup XbSilo for '%s'", -+ gs_flatpak_get_id (self)); -+ return FALSE; -+ } - if (!gs_appstream_url_to_app (self->plugin, self->silo, list_tmp, url, cancellable, error)) - return FALSE; - diff --git a/0018-fwupd-Fix-the-user-action-dialogs.patch b/0018-fwupd-Fix-the-user-action-dialogs.patch deleted file mode 100644 index e45e21e..0000000 --- a/0018-fwupd-Fix-the-user-action-dialogs.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 9aba963f2274e929658b632d6f6ce9c73ee83156 Mon Sep 17 00:00:00 2001 -From: Richard Hughes -Date: Tue, 14 Jun 2022 13:04:31 +0100 -Subject: [PATCH 18/18] fwupd: Fix the user action dialogs - -When gnome-software was ported from appstream-glib to libappstream we -missed that the locale arguments are now swapped -- i.e. the former -specified "locale, value" and the latter specified "value, locale". - -This fixes installing software on any devices that require some kind of -user-prompting to complete the update, e.g. buttons that need pressing -or cables that need replugging. ---- - plugins/fwupd/gs-fwupd-app.c | 2 +- - plugins/fwupd/gs-plugin-fwupd.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c -index 03103a3e9..7fcbdadab 100644 ---- a/plugins/fwupd/gs-fwupd-app.c -+++ b/plugins/fwupd/gs-fwupd-app.c -@@ -283,7 +283,7 @@ gs_fwupd_app_set_from_release (GsApp *app, FwupdRelease *rel) - as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT); - as_screenshot_add_image (ss, im); - if (fwupd_release_get_detach_caption (rel) != NULL) -- as_screenshot_set_caption (ss, NULL, fwupd_release_get_detach_caption (rel)); -+ as_screenshot_set_caption (ss, fwupd_release_get_detach_caption (rel), NULL); - gs_app_set_action_screenshot (app, ss); - } - } -diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c -index cac6a324a..3171eb96d 100644 ---- a/plugins/fwupd/gs-plugin-fwupd.c -+++ b/plugins/fwupd/gs-plugin-fwupd.c -@@ -945,7 +945,7 @@ gs_plugin_fwupd_install (GsPluginFwupd *self, - - /* caption is required */ - as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_DEFAULT); -- as_screenshot_set_caption (ss, NULL, fwupd_device_get_update_message (dev)); -+ as_screenshot_set_caption (ss, fwupd_device_get_update_message (dev), NULL); - gs_app_set_action_screenshot (app, ss); - - /* require the dialog */ --- -2.36.1 - diff --git a/gnome-software.spec b/gnome-software.spec index 2714eaf..8da324a 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -15,8 +15,8 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42.2 -Release: 4%{?dist} +Version: 42.3 +Release: 1%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -25,8 +25,6 @@ Source0: https://download.gnome.org/sources/gnome-software/42/%{name}-%{tarbal Patch01: 0001-crash-with-broken-theme.patch Patch02: 0002-shell-setup-order.patch -Patch03: 0003-crash-under-gs-flatpak-refine-app-unlocked.patch -Patch04: 0018-fwupd-Fix-the-user-action-dialogs.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -201,6 +199,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Fri Jul 01 2022 Milan Crha - 42.3-1 +- Update to 42.3 + * Fri Jun 17 2022 Richard Hughes - 42.2-4 - Add patch to make fwupd user requests work diff --git a/sources b/sources index fc682d9..cfb11ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.2.tar.xz) = 2b231afbedb241b8957fa902c37cd85734cdb8b2071cd32ac75ae2e9e064483fe1e9e8d49f2e6df478fdd01e9c6225a85887ba2af1792a9150b89cea75ef8bb4 +SHA512 (gnome-software-42.3.tar.xz) = 8adae64b3149145548fc80ba3491e92d47a711341020b8edb53333f07367b0e2d37864940af71a35d980f634e7a1df68e9fde3c56d17c8e482699358c8eba8b7 From b686add992d5f38adefce95cd5bdada6c7ea6558 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 5 Aug 2022 11:57:07 +0200 Subject: [PATCH 17/18] Update to 42.4 --- gnome-software.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gnome-software.spec b/gnome-software.spec index 8da324a..2c2a310 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -15,7 +15,7 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-software -Version: 42.3 +Version: 42.4 Release: 1%{?dist} Summary: A software center for GNOME @@ -199,6 +199,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Fri Aug 05 2022 Milan Crha - 42.4-1 +- Update to 42.4 + * Fri Jul 01 2022 Milan Crha - 42.3-1 - Update to 42.3 diff --git a/sources b/sources index cfb11ae..f10ad13 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-software-42.3.tar.xz) = 8adae64b3149145548fc80ba3491e92d47a711341020b8edb53333f07367b0e2d37864940af71a35d980f634e7a1df68e9fde3c56d17c8e482699358c8eba8b7 +SHA512 (gnome-software-42.4.tar.xz) = 00c70886c6e3302a59ae533034d8d75cfe05873ea40d0d05a03e15ae34101bb8a64722a7c6a6d43bb54b61033bc14af1542bb832a70ee7b1a2dab6dacb8ffd8f From 5457a5ba01c1ba3c9355095540ca7eabbae62d85 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 12 Sep 2022 09:04:52 +0200 Subject: [PATCH 18/18] Resolves: #2125569 (Correct property name in GsRemovalDialog .ui file) --- 0008-gs-removal-dialog-crrect-property-name.patch | 13 +++++++++++++ gnome-software.spec | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 0008-gs-removal-dialog-crrect-property-name.patch diff --git a/0008-gs-removal-dialog-crrect-property-name.patch b/0008-gs-removal-dialog-crrect-property-name.patch new file mode 100644 index 0000000..f800b2c --- /dev/null +++ b/0008-gs-removal-dialog-crrect-property-name.patch @@ -0,0 +1,13 @@ +diff --git a/src/gs-removal-dialog.ui b/src/gs-removal-dialog.ui +index 298900eb2..0cff1321a 100644 +--- a/src/gs-removal-dialog.ui ++++ b/src/gs-removal-dialog.ui +@@ -1,7 +1,7 @@ + + +