Fix opening results from gnome-shell search provider

This commit is contained in:
Kalev Lember 2018-03-15 12:02:28 +01:00
parent f37cf8e784
commit 7737b8e64a
2 changed files with 69 additions and 2 deletions

View File

@ -0,0 +1,63 @@
From 047a077a0ac308fabe002ad3099b8e1f2f24eccd Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Thu, 15 Mar 2018 11:23:52 +0100
Subject: [PATCH] appstream: Don't compare appstream origin to package origin
Use new as_utils_unique_id_match() from appstream-glib 0.7.8 to ignore
origin when matching AsApp to GsApp. In Fedora, we have all of system
appstream coming from system-installed appstream-data package that has
origin "fedora", but actual packages come from e.g. "updates-testing"
which doesn't match up.
---
plugins/core/gs-plugin-appstream.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 9ca091112231..3cd95c586eae 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -527,11 +527,28 @@ gs_plugin_refine_wildcard (GsPlugin *plugin,
g_autoptr(GsApp) new = NULL;
/* is compatible */
+#if AS_CHECK_VERSION(0,7,8)
+ if (!as_utils_unique_id_match (gs_app_get_unique_id (app),
+ as_app_get_unique_id (item),
+ AS_UNIQUE_ID_MATCH_FLAG_SCOPE |
+ AS_UNIQUE_ID_MATCH_FLAG_BUNDLE_KIND |
+ /* don't match origin as AsApp appstream
+ * origin can differ from package origin */
+ AS_UNIQUE_ID_MATCH_FLAG_KIND |
+ AS_UNIQUE_ID_MATCH_FLAG_ID |
+ AS_UNIQUE_ID_MATCH_FLAG_BRANCH)) {
+ g_debug ("does not match unique ID constraints: %s, %s",
+ gs_app_get_unique_id (app),
+ as_app_get_unique_id (item));
+ continue;
+ }
+#else
if (!as_utils_unique_id_equal (gs_app_get_unique_id (app),
as_app_get_unique_id (item))) {
g_debug ("does not match unique ID constraints");
continue;
}
+#endif
/* does the app have an installation method */
if (as_app_get_pkgname_default (item) == NULL &&
--
2.16.2
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 3cd95c586eae..8e558824caca 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -527,7 +527,7 @@ gs_plugin_refine_wildcard (GsPlugin *plugin,
g_autoptr(GsApp) new = NULL;
/* is compatible */
-#if AS_CHECK_VERSION(0,7,8)
+#if AS_CHECK_VERSION(0,7,7)
if (!as_utils_unique_id_match (gs_app_get_unique_id (app),
as_app_get_unique_id (item),
AS_UNIQUE_ID_MATCH_FLAG_SCOPE |

View File

@ -2,7 +2,7 @@
%global gtk3_version 3.22.4
%global json_glib_version 1.2.0
%global packagekit_version 1.1.1
%global appstream_glib_version 0.7.3
%global appstream_glib_version 0.7.7-2
%global libsoup_version 2.52.0
%global gsettings_desktop_schemas_version 3.12.0
%global gnome_desktop_version 3.18.0
@ -11,7 +11,7 @@
Name: gnome-software
Version: 3.28.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A software center for GNOME
License: GPLv2+
@ -21,6 +21,7 @@ Source0: https://download.gnome.org/sources/gnome-software/3.28/%{name}-%{vers
# Backported from upstream
Patch0: 0001-Revert-Revert-trivial-Use-new-libappstream-glib-to-b.patch
Patch1: 0001-plugin-loader-Don-t-abort-for-refine-errors.patch
Patch2: 0001-appstream-Don-t-compare-appstream-origin-to-package-.patch
BuildRequires: gettext
BuildRequires: libxslt
@ -214,6 +215,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_mandir}/man1/gnome-software-editor.1*
%changelog
* Thu Mar 15 2018 Kalev Lember <klember@redhat.com> - 3.28.0-4
- Fix opening results from gnome-shell search provider
* Wed Mar 14 2018 Kalev Lember <klember@redhat.com> - 3.28.0-3
- Fix crash on initial run with no network (#1554986)