[PackageKit/f20-gnome-3-12] Backport an offline updates fix

Kalev Lember kalev at fedoraproject.org
Tue Jun 10 09:21:36 UTC 2014


commit fecdd961fee48e808fe1dd348dd8ec6e4abba174
Author: Kalev Lember <kalevlember at gmail.com>
Date:   Tue Jun 10 11:18:45 2014 +0200

    Backport an offline updates fix

 0002-hawkey-Correctly-set-the-cleanup-status.patch |   41 ++++++++++++++++++++
 PackageKit.spec                                    |    8 +++-
 2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/0002-hawkey-Correctly-set-the-cleanup-status.patch b/0002-hawkey-Correctly-set-the-cleanup-status.patch
new file mode 100644
index 0000000..984d144
--- /dev/null
+++ b/0002-hawkey-Correctly-set-the-cleanup-status.patch
@@ -0,0 +1,41 @@
+From 5887a114b86e87d6446d4a363dcd73f7f1ee1241 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalevlember at gmail.com>
+Date: Sun, 8 Jun 2014 12:33:24 +0200
+Subject: [PATCH] hawkey: Correctly set the cleanup status
+
+We were wrongly setting the cleanup status not on the removed package,
+but on the one that got installed as a replacement.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=79791
+---
+ backends/hawkey/pk-backend-hawkey.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/backends/hawkey/pk-backend-hawkey.c b/backends/hawkey/pk-backend-hawkey.c
+index 74ff632..bb71098 100644
+--- a/backends/hawkey/pk-backend-hawkey.c
++++ b/backends/hawkey/pk-backend-hawkey.c
+@@ -3223,7 +3223,7 @@ pk_backend_transaction_commit (PkBackendJob *job, HifState *state, GError **erro
+ 
+ 	/* add anything that gets obsoleted to a helper array which is used to
+ 	 * map removed packages auto-added by rpm to actual HyPackage's */
+-	commit->remove_helper = g_ptr_array_new ();
++	commit->remove_helper = g_ptr_array_new_with_free_func ((GDestroyNotify) hy_package_free);
+ 	for (i = 0; i < commit->install->len; i++) {
+ 		pkg = g_ptr_array_index (commit->install, i);
+ 		is_update = hif_package_get_status (pkg) == PK_STATUS_ENUM_UPDATE;
+@@ -3231,8 +3231,9 @@ pk_backend_transaction_commit (PkBackendJob *job, HifState *state, GError **erro
+ 			continue;
+ 		pkglist = hy_goal_list_obsoleted_by_package (job_data->goal, pkg);
+ 		FOR_PACKAGELIST(pkg_tmp, pkglist, j) {
+-			g_ptr_array_add (commit->remove_helper, pkg);
+-			hif_package_set_status (pkg, PK_STATUS_ENUM_CLEANUP);
++			g_ptr_array_add (commit->remove_helper,
++			                 hy_package_link (pkg_tmp));
++			hif_package_set_status (pkg_tmp, PK_STATUS_ENUM_CLEANUP);
+ 		}
+ 		hy_packagelist_free (pkglist);
+ 	}
+-- 
+2.0.0
+
diff --git a/PackageKit.spec b/PackageKit.spec
index af6c7d1..407a7f2 100644
--- a/PackageKit.spec
+++ b/PackageKit.spec
@@ -9,7 +9,7 @@
 Summary:   Package management service
 Name:      PackageKit
 Version:   0.9.2
-Release:   4%{?dist}
+Release:   5%{?dist}
 License:   GPLv2+ and LGPLv2+
 URL:       http://www.freedesktop.org/software/PackageKit/
 Source0:   http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
@@ -18,6 +18,8 @@ Source0:   http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{ver
 Patch0:    PackageKit-0.3.8-Fedora-Vendor.conf.patch
 # Upstream fix for parallel kernel package installation
 Patch1:    0001-hif-Reimplement-multiple-kernel-package-installation.patch
+# Another upstream fix for offline updates
+Patch2:    0002-hawkey-Correctly-set-the-cleanup-status.patch
 
 Requires: %{name}-glib%{?_isa} = %{version}-%{release}
 Requires: shared-mime-info
@@ -181,6 +183,7 @@ using PackageKit.
 #%setup -q -n %{name}-%{version}-%{gitdate}
 %patch0 -p1 -b .fedora
 %patch1 -p1
+%patch2 -p1
 
 %build
 %configure \
@@ -347,6 +350,9 @@ popd > /dev/null
 %{_libdir}/pkgconfig/packagekit-plugin.pc
 
 %changelog
+* Tue Jun 10 2014 Kalev Lember <kalevlember at gmail.com> - 0.9.2-5
+- Backport an offline updates fix
+
 * Fri Jun 06 2014 Kalev Lember <kalevlember at gmail.com> - 0.9.2-4
 - Rebuilt for new hawkey
 


More information about the scm-commits mailing list