[neon/backports-jammy/packagekit/Neon/release] debian/patches: Add ABI patch for appstream chages.

Scarlett Moore null at kde.org
Thu Sep 21 13:14:33 BST 2023


Git commit 81af0d83b8aeb53fbf5ebca6d0c0c63e4d68a286 by Scarlett Moore.
Committed on 21/09/2023 at 14:13.
Pushed by scarlettmoore into branch 'Neon/release'.

Add ABI patch for appstream chages.

M  +1    -0    debian/patches/series
A  +70   -0    debian/patches/upstream_appstream_abi_fix.patch

https://invent.kde.org/neon/backports-jammy/packagekit/-/commit/81af0d83b8aeb53fbf5ebca6d0c0c63e4d68a286

diff --git a/debian/patches/series b/debian/patches/series
index 2cf19ff..f52c435 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 restart-on-sddm
 policy.diff
 fix_mime.patch
+upstream_appstream_abi_fix.patch
diff --git a/debian/patches/upstream_appstream_abi_fix.patch b/debian/patches/upstream_appstream_abi_fix.patch
new file mode 100644
index 0000000..c4f6544
--- /dev/null
+++ b/debian/patches/upstream_appstream_abi_fix.patch
@@ -0,0 +1,70 @@
+From 7a2e1e81e5831a599660a2f8a7235d01100372e3 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Thu, 21 Sep 2023 05:15:48 +0200
+Subject: [PATCH] Adjust for upcoming AppStream 1.0 API changes
+
+This is a work-in-progress, as AppStream 1.0 is not released yet.
+
+Resolves: #670
+---
+ backends/apt/apt-job.cpp              | 13 +++++++++++--
+ backends/dnf/pk-backend-dnf-refresh.c |  1 -
+ backends/dnf/pk-backend-dnf.c         |  1 -
+ 3 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/backends/apt/apt-job.cpp b/backends/apt/apt-job.cpp
+index d68c98faa..907059c83 100644
+--- a/backends/apt/apt-job.cpp
++++ b/backends/apt/apt-job.cpp
+@@ -1460,16 +1460,25 @@ void AptJob::providesMimeType(PkgList &output, gchar **values)
+ 
+     /* search for mimetypes for all values */
+     for (guint i = 0; values[i] != NULL; i++) {
++#if AS_CHECK_VERSION(1,0,0)
++        g_autoptr(AsComponentBox) result = NULL;
++#else
+         g_autoptr(GPtrArray) result = NULL;
+-
++#endif
+         if (m_cancel)
+             break;
+ 
++#if AS_CHECK_VERSION(1,0,0)
++        result = as_pool_get_components_by_provided_item (pool, AS_PROVIDED_KIND_MEDIATYPE, values[i]);
++        for (guint j = 0; j < as_component_box_len (result); j++) {
++            const gchar *pkgname;
++            AsComponent *cpt = as_component_box_index (result, j);
++#else
+         result = as_pool_get_components_by_provided_item (pool, AS_PROVIDED_KIND_MEDIATYPE, values[i]);
+         for (guint j = 0; j < result->len; j++) {
+             const gchar *pkgname;
+             AsComponent *cpt = AS_COMPONENT (g_ptr_array_index (result, j));
+-
++#endif
+             /* sanity check */
+             pkgname = as_component_get_pkgname (cpt);
+             if (pkgname == NULL) {
+diff --git a/backends/dnf/pk-backend-dnf-refresh.c b/backends/dnf/pk-backend-dnf-refresh.c
+index 6d87dc819..efbb12233 100644
+--- a/backends/dnf/pk-backend-dnf-refresh.c
++++ b/backends/dnf/pk-backend-dnf-refresh.c
+@@ -26,7 +26,6 @@
+ #include <glib/gstdio.h>
+ #include <glib/gi18n.h>
+ #include <string.h>
+-#include <appstream-glib.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ 
+diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
+index be99a6df9..4c4bc1f17 100644
+--- a/backends/dnf/pk-backend-dnf.c
++++ b/backends/dnf/pk-backend-dnf.c
+@@ -25,7 +25,6 @@
+ #include <glib.h>
+ #include <glib/gstdio.h>
+ #include <string.h>
+-#include <appstream-glib.h>
+ 
+ #include <pk-backend.h>
+ #include <packagekit-glib2/pk-common-private.h>


More information about the Neon-commits mailing list