Blob Blame History Raw
From f91c54a70860ed12270bbafa121acae36f29badb Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 18 Dec 2018 02:44:31 +0100
Subject: [PATCH] Lower AsStore new API version checks for Fedora

We have new the AsStore thread safety patches along with new thread safe
API backported to libappstream-glib-0.7.14-3.fc29.
---
 plugins/core/gs-appstream.c        | 12 ++++++------
 plugins/core/gs-plugin-appstream.c | 12 ++++++------
 plugins/flatpak/gs-flatpak.c       |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index b7bccd19a..7b606fe0d 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -860,7 +860,7 @@ gs_appstream_store_search (GsPlugin *plugin,
 	gboolean ret = TRUE;
 	g_autoptr(GPtrArray) array = NULL;
 
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
@@ -937,7 +937,7 @@ gs_appstream_store_add_category_apps (GsPlugin *plugin,
 	g_autoptr(GPtrArray) array = NULL;
 
 	/* just look at each app in turn */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
@@ -985,7 +985,7 @@ gs_appstream_store_add_categories (GsPlugin *plugin,
 	g_autoptr(GPtrArray) array = NULL;
 
 	/* find out how many packages are in each category */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
@@ -1013,7 +1013,7 @@ gs_appstream_add_popular (GsPlugin *plugin,
 {
 	g_autoptr(GPtrArray) array = NULL;
 
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
@@ -1059,7 +1059,7 @@ gs_appstream_add_recent (GsPlugin *plugin,
 {
 	g_autoptr(GPtrArray) array = NULL;
 
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
@@ -1088,7 +1088,7 @@ gs_appstream_add_featured (GsPlugin *plugin,
 {
 	g_autoptr(GPtrArray) array = NULL;
 
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (store));
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index 77d004162..ce0ca9bda 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -56,7 +56,7 @@ gs_plugin_appstream_create_app_hash (AsStore *store)
 
 	hash = g_hash_table_new_full (g_str_hash, g_str_equal,
 				      g_free, (GDestroyNotify) g_object_unref);
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	apps = as_store_dup_apps (store);
 #else
 	apps = g_ptr_array_ref (as_store_get_apps (store));
@@ -290,7 +290,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
 			return FALSE;
 		}
 	}
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	items = as_store_dup_apps (priv->store);
 #else
 	items = g_ptr_array_ref (as_store_get_apps (priv->store));
@@ -391,7 +391,7 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
 		g_autoptr(GPtrArray) apps_merge = NULL;
 
 		g_debug ("no app with ID %s found in system appstream", unique_id);
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 		apps = as_store_dup_apps (priv->store);
 #else
 		apps = g_ptr_array_ref (as_store_get_apps (priv->store));
@@ -405,7 +405,7 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
 		}
 
 		/* fall back to trying to get a merge app */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 		apps_merge = as_store_dup_apps_by_id_merge (priv->store, gs_app_get_id (app));
 		for (guint i = 0; i < apps_merge->len; i++) {
 			item = g_ptr_array_index (apps_merge, i);
@@ -472,7 +472,7 @@ gs_plugin_add_distro_upgrades (GsPlugin *plugin,
 	g_autoptr(GPtrArray) array = NULL;
 
 	/* find any upgrades */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (priv->store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (priv->store));
@@ -620,7 +620,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
 	g_autoptr(GPtrArray) array = NULL;
 
 	/* search categories for the search term */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	array = as_store_dup_apps (priv->store);
 #else
 	array = g_ptr_array_ref (as_store_get_apps (priv->store));
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index b835d843c..921fd12e9 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -328,7 +328,7 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
 	}
 
 	/* override the *AppStream* origin */
-#if AS_CHECK_VERSION(0,7,15)
+#if AS_CHECK_VERSION(0,7,14)
 	apps = as_store_dup_apps (store);
 #else
 	apps = g_ptr_array_ref (as_store_get_apps (store));
-- 
2.19.1