[PackageKit/0.8.4] Backport some more fixes from upstream to hopefully fix apper.

Richard Hughes rhughes at fedoraproject.org
Wed Oct 31 13:39:09 UTC 2012


commit 43d4ca3811b0cdde68a130da1594f23a76a2b443
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Oct 31 13:41:40 2012 +0000

    Backport some more fixes from upstream to hopefully fix apper.

 ...-simulation-of-spawned-transactions-corre.patch |  171 ++++++++++++++++++--
 PackageKit.spec                                    |    5 +-
 2 files changed, 159 insertions(+), 17 deletions(-)
---
diff --git a/0001-Perform-the-simulation-of-spawned-transactions-corre.patch b/0001-Perform-the-simulation-of-spawned-transactions-corre.patch
index c7f0901..621c20d 100644
--- a/0001-Perform-the-simulation-of-spawned-transactions-corre.patch
+++ b/0001-Perform-the-simulation-of-spawned-transactions-corre.patch
@@ -1,16 +1,3 @@
-From fc9b6653a3f6ca4c1b27045292f7e09bdfb865ca Mon Sep 17 00:00:00 2001
-From: Richard Hughes <richard at hughsie.com>
-Date: Tue, 30 Oct 2012 16:09:17 +0000
-Subject: [PATCH] Perform the simulation of spawned transactions correctly
-
-Backends that were checking for 'simulate' were being sent the typo 'simluate'
-by the daemon which was producing undefined and unexpected results.
-
-Hopefully fixes: https://bugzilla.redhat.com/show_bug.cgi?id=866486
----
- lib/packagekit-glib2/pk-enum.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 diff --git a/lib/packagekit-glib2/pk-enum.c b/lib/packagekit-glib2/pk-enum.c
 index bc08d7c..8f556a6 100644
 --- a/lib/packagekit-glib2/pk-enum.c
@@ -24,6 +11,158 @@ index bc08d7c..8f556a6 100644
  	{PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD, "only-download"},
  	{0, NULL}
  };
--- 
-1.7.12.1
-
+diff --git a/src/pk-backend-job.c b/src/pk-backend-job.c
+index d9f920a..a575800 100644
+--- a/src/pk-backend-job.c
++++ b/src/pk-backend-job.c
+@@ -574,6 +574,59 @@ typedef struct {
+ } PkBackendJobVFuncHelper;
+ 
+ /**
++ * pk_backend_job_signal_to_string:
++ **/
++static const gchar *
++pk_backend_job_signal_to_string (PkBackendJobSignal id)
++{
++	if (id == PK_BACKEND_SIGNAL_ALLOW_CANCEL)
++		return "AllowCancel";
++	if (id == PK_BACKEND_SIGNAL_DETAILS)
++		return "Details";
++	if (id == PK_BACKEND_SIGNAL_ERROR_CODE)
++		return "ErrorCode";
++	if (id == PK_BACKEND_SIGNAL_DISTRO_UPGRADE)
++		return "DistroUpgrade";
++	if (id == PK_BACKEND_SIGNAL_FINISHED)
++		return "Finished";
++	if (id == PK_BACKEND_SIGNAL_MESSAGE)
++		return "Message";
++	if (id == PK_BACKEND_SIGNAL_PACKAGE)
++		return "Package";
++	if (id == PK_BACKEND_SIGNAL_ITEM_PROGRESS)
++		return "ItemProgress";
++	if (id == PK_BACKEND_SIGNAL_FILES)
++		return "Files";
++	if (id == PK_BACKEND_SIGNAL_PERCENTAGE)
++		return "Percentage";
++	if (id == PK_BACKEND_SIGNAL_REMAINING)
++		return "Remaining";
++	if (id == PK_BACKEND_SIGNAL_SPEED)
++		return "Speed";
++	if (id == PK_BACKEND_SIGNAL_DOWNLOAD_SIZE_REMAINING)
++		return "DownloadSizeRemaining";
++	if (id == PK_BACKEND_SIGNAL_REPO_DETAIL)
++		return "RepoDetail";
++	if (id == PK_BACKEND_SIGNAL_REPO_SIGNATURE_REQUIRED)
++		return "RepoSignatureRequired";
++	if (id == PK_BACKEND_SIGNAL_EULA_REQUIRED)
++		return "EulaRequired";
++	if (id == PK_BACKEND_SIGNAL_MEDIA_CHANGE_REQUIRED)
++		return "MediaChangeRequired";
++	if (id == PK_BACKEND_SIGNAL_REQUIRE_RESTART)
++		return "RequireRestart";
++	if (id == PK_BACKEND_SIGNAL_STATUS_CHANGED)
++		return "StatusChanged";
++	if (id == PK_BACKEND_SIGNAL_LOCKED_CHANGED)
++		return "LockedChanged";
++	if (id == PK_BACKEND_SIGNAL_UPDATE_DETAIL)
++		return "UpdateDetail";
++	if (id == PK_BACKEND_SIGNAL_CATEGORY)
++		return "Category";
++	return NULL;
++}
++
++/**
+  * pk_backend_job_call_vfunc_idle_cb:
+  **/
+ static gboolean
+@@ -584,13 +637,13 @@ pk_backend_job_call_vfunc_idle_cb (gpointer user_data)
+ 
+ 	/* call transaction vfunc on main thread */
+ 	item = &helper->job->priv->vfunc_items[helper->signal_kind];
+-	if (item != NULL) {
++	if (item != NULL && item->vfunc != NULL) {
+ 		item->vfunc (helper->job,
+ 			     helper->object,
+ 			     item->user_data);
+ 	} else {
+-		g_warning ("tried to do signal %i when no longer connected",
+-			   helper->signal_kind);
++		g_warning ("tried to do signal %s when no longer connected",
++			   pk_backend_job_signal_to_string (helper->signal_kind));
+ 	}
+ 	if (helper->destroy_func != NULL)
+ 		helper->destroy_func (helper->object);
+diff --git a/src/pk-transaction.c b/src/pk-transaction.c
+index 75d6136..810c771 100644
+--- a/src/pk-transaction.c
++++ b/src/pk-transaction.c
+@@ -299,6 +299,12 @@ pk_transaction_finish_invalidate_caches (PkTransaction *transaction)
+ 	pk_cache_set_results (priv->cache, priv->role, priv->results);
+ 
+ 	/* could the update list have changed? */
++	if (pk_bitfield_contain (transaction->priv->cached_transaction_flags,
++				  PK_TRANSACTION_FLAG_ENUM_SIMULATE))
++		goto out;
++	if (pk_bitfield_contain (transaction->priv->cached_transaction_flags,
++				  PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD))
++		goto out;
+ 	if (priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES ||
+ 	    priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES ||
+ 	    priv->role == PK_ROLE_ENUM_REPO_ENABLE ||
+@@ -313,6 +319,7 @@ pk_transaction_finish_invalidate_caches (PkTransaction *transaction)
+ 		pk_notify_wait_updates_changed (priv->notify,
+ 						PK_TRANSACTION_UPDATES_CHANGED_TIMEOUT);
+ 	}
++out:
+ 	return TRUE;
+ }
+ 
+@@ -987,11 +994,12 @@ pk_transaction_plugin_phase (PkTransaction *transaction,
+ 				g_main_context_iteration (context, FALSE);
+ 		}
+ 
++		/* quit the transaction if any of the plugins fail */
+ 		exit_code = pk_backend_job_get_exit_code (job);
+-		if (exit_code != PK_EXIT_ENUM_UNKNOWN) {
++		if (exit_code != PK_EXIT_ENUM_UNKNOWN &&
++		    exit_code != PK_EXIT_ENUM_SUCCESS) {
+ 			pk_backend_job_set_exit_code (transaction->priv->job, exit_code);
+-			if (exit_code != PK_EXIT_ENUM_SUCCESS)
+-				break;
++			break;
+ 		}
+ 	}
+ out:
+diff --git a/src/plugins/pk-plugin-check-shared-libraries-in-use.c b/src/plugins/pk-plugin-check-shared-libraries-in-use.c
+index 2a3f4a6..1c09649 100644
+--- a/src/plugins/pk-plugin-check-shared-libraries-in-use.c
++++ b/src/plugins/pk-plugin-check-shared-libraries-in-use.c
+@@ -95,6 +95,17 @@ pk_plugin_finished_cb (PkBackendJob *job,
+ }
+ 
+ /**
++ * pk_plugin_package_cb:
++ **/
++static void
++pk_plugin_package_cb (PkBackendJob *job,
++		      PkPackage *package,
++		      PkPlugin *plugin)
++{
++	g_ptr_array_add (plugin->priv->list, g_object_ref (package));
++}
++
++/**
+  * pk_plugin_get_installed_package_for_file:
+  **/
+ static PkPackage *
+@@ -109,8 +120,8 @@ pk_plugin_get_installed_package_for_file (PkPlugin *plugin,
+ 	g_ptr_array_set_size (plugin->priv->list, 0);
+ 	pk_backend_reset_job (plugin->backend, plugin->job);
+ 	pk_backend_job_set_vfunc (plugin->job,
+-				  PK_BACKEND_SIGNAL_FILES,
+-				  (PkBackendJobVFunc) pk_plugin_files_cb,
++				  PK_BACKEND_SIGNAL_PACKAGE,
++				  (PkBackendJobVFunc) pk_plugin_package_cb,
+ 				  plugin);
+ 	pk_backend_job_set_vfunc (plugin->job,
+ 				  PK_BACKEND_SIGNAL_FINISHED,
diff --git a/PackageKit.spec b/PackageKit.spec
index f388039..e34a95e 100644
--- a/PackageKit.spec
+++ b/PackageKit.spec
@@ -3,7 +3,7 @@
 Summary:   Package management service
 Name:      PackageKit
 Version:   0.8.4
-Release:   6%{?dist}
+Release:   7%{?dist}
 
 License:   GPLv2+ and LGPLv2+
 URL:       http://www.packagekit.org
@@ -483,6 +483,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
 %{_libdir}/pkgconfig/packagekit-plugin.pc
 
 %changelog
+* Wed Oct 31 2012 Richard Hughes  <rhughes at redhat.com> - 0.8.4-7
+- Backport some more fixes from upstream to hopefully fix apper.
+
 * Tue Oct 30 2012 Richard Hughes  <rhughes at redhat.com> - 0.8.4-6
 - Perform the simulation of spawned transactions correctly (#866486)
 


More information about the scm-commits mailing list