From b673ba1359f427bb69919db3a3336f2dde15d1ba Mon Sep 17 00:00:00 2001 From: Kalev Lember 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 8d6d56e..91f9f9d 100644 --- a/backends/hawkey/pk-backend-hawkey.c +++ b/backends/hawkey/pk-backend-hawkey.c @@ -3245,7 +3245,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; @@ -3263,8 +3263,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); + HyPackage pkg_cleanup = hy_package_link (pkg_tmp); + g_ptr_array_add (commit->remove_helper, pkg_cleanup); + hif_package_set_status (pkg_cleanup, PK_STATUS_ENUM_CLEANUP); } hy_packagelist_free (pkglist); } -- 2.0.0