From e7e2d3ae630f1349d2fc1e65fe8afa285e64e6c7 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 19 Jul 2021 14:14:13 +0200 Subject: [PATCH] Resolves: #1983553 (Add rpm-ostree patch to hide packages from the search results; Add patch to implement what-provides search in the Flatpak plugin) --- ...e-Hide-only-Web-and-Console-applicat.patch | 29 ++++++++ ...t-gs_plugin_add_search_what_provides.patch | 72 +++++++++++++++++++ gnome-software.spec | 9 ++- 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 0002-Revert-rpm-ostree-Hide-only-Web-and-Console-applicat.patch create mode 100644 0003-flatpak-Implement-gs_plugin_add_search_what_provides.patch diff --git a/0002-Revert-rpm-ostree-Hide-only-Web-and-Console-applicat.patch b/0002-Revert-rpm-ostree-Hide-only-Web-and-Console-applicat.patch new file mode 100644 index 0000000..bcec2fd --- /dev/null +++ b/0002-Revert-rpm-ostree-Hide-only-Web-and-Console-applicat.patch @@ -0,0 +1,29 @@ +From 7667bb916408b61c4630837d4483be266bf6a799 Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Mon, 12 Jul 2021 14:54:26 +0200 +Subject: [PATCH 1/2] Revert "rpm-ostree: Hide only Web and Console + applications from the search" + +This reverts commit ef67695cb2e20f0cb1cfcd8965173226dd755b09. + +The correct fix for https://gitlab.gnome.org/GNOME/gnome-software/-/issues/613 +is https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1210 +--- + plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +index 6b1a1351..541b59f8 100644 +--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c ++++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c +@@ -1598,6 +1598,7 @@ resolve_available_packages_app (GsPlugin *plugin, + /* set hide-from-search quirk for available apps we don't want to show */ + if (!gs_app_is_installed (app)) { + switch (gs_app_get_kind (app)) { ++ case AS_COMPONENT_KIND_DESKTOP_APP: + case AS_COMPONENT_KIND_WEB_APP: + case AS_COMPONENT_KIND_CONSOLE_APP: + gs_app_add_quirk (app, GS_APP_QUIRK_HIDE_FROM_SEARCH); +-- +2.31.1 + diff --git a/0003-flatpak-Implement-gs_plugin_add_search_what_provides.patch b/0003-flatpak-Implement-gs_plugin_add_search_what_provides.patch new file mode 100644 index 0000000..d0b0e8d --- /dev/null +++ b/0003-flatpak-Implement-gs_plugin_add_search_what_provides.patch @@ -0,0 +1,72 @@ +From f148ef7e91716bf6cac069eb61f0ecb370507dc9 Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Thu, 15 Apr 2021 18:49:08 +0200 +Subject: [PATCH 2/2] flatpak: Implement gs_plugin_add_search_what_provides() + +Let the Flatpak plugin search for "what provides" as well. It's the same +search, due to the appstream search terms, and it gets more results to +pick from. + +Related https://gitlab.gnome.org/GNOME/gnome-software/-/issues/613 +Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1210 +--- + plugins/flatpak/gs-plugin-flatpak.c | 33 +++++++++++++++++++++++------ + 1 file changed, 27 insertions(+), 6 deletions(-) + +diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c +index 364bc27d..808e1a56 100644 +--- a/plugins/flatpak/gs-plugin-flatpak.c ++++ b/plugins/flatpak/gs-plugin-flatpak.c +@@ -1444,12 +1444,12 @@ gs_plugin_file_to_app (GsPlugin *plugin, + return TRUE; + } + +-gboolean +-gs_plugin_add_search (GsPlugin *plugin, +- gchar **values, +- GsAppList *list, +- GCancellable *cancellable, +- GError **error) ++static gboolean ++gs_plugin_flatpak_do_search (GsPlugin *plugin, ++ gchar **values, ++ GsAppList *list, ++ GCancellable *cancellable, ++ GError **error) + { + GsPluginData *priv = gs_plugin_get_data (plugin); + for (guint i = 0; i < priv->flatpaks->len; i++) { +@@ -1459,9 +1459,30 @@ gs_plugin_add_search (GsPlugin *plugin, + return FALSE; + } + } ++ + return TRUE; + } + ++gboolean ++gs_plugin_add_search (GsPlugin *plugin, ++ gchar **values, ++ GsAppList *list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ return gs_plugin_flatpak_do_search (plugin, values, list, cancellable, error); ++} ++ ++gboolean ++gs_plugin_add_search_what_provides (GsPlugin *plugin, ++ gchar **search, ++ GsAppList *list, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ return gs_plugin_flatpak_do_search (plugin, search, list, cancellable, error); ++} ++ + gboolean + gs_plugin_add_categories (GsPlugin *plugin, + GPtrArray *list, +-- +2.31.1 + diff --git a/gnome-software.spec b/gnome-software.spec index 78f3a1e..e05578c 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -12,7 +12,7 @@ Name: gnome-software Version: 40.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A software center for GNOME License: GPLv2+ @@ -20,6 +20,8 @@ URL: https://wiki.gnome.org/Apps/Software Source0: https://download.gnome.org/sources/gnome-software/40/%{name}-%{tarball_version}.tar.xz Patch01: 0001-crash-with-broken-theme.patch +Patch02: 0002-Revert-rpm-ostree-Hide-only-Web-and-Console-applicat.patch +Patch03: 0003-flatpak-Implement-gs_plugin_add_search_what_provides.patch BuildRequires: appstream-devel >= %{appstream_version} BuildRequires: gcc @@ -202,6 +204,11 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/gtk-doc/html/gnome-software %changelog +* Mon Jul 19 2021 Milan Crha - 40.3-2 +- Resolves: #1983553 +- Add rpm-ostree patch to hide packages from the search results +- Add patch to implement what-provides search in the Flatpak plugin + * Mon Jul 12 2021 Milan Crha - 40.3-1 - Related: #1981296 (Update to 40.3)