Blob Blame Raw
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
+++ b/lib/packagekit-glib2/pk-enum.c
@@ -401,7 +401,7 @@ static const PkEnumMatch enum_upgrade_kind[] = {
 static const PkEnumMatch enum_transaction_flag[] = {
 	{PK_TRANSACTION_FLAG_ENUM_NONE,		"none"},	/* fall though value */
 	{PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED,	"only-trusted"},
-	{PK_TRANSACTION_FLAG_ENUM_SIMULATE,	"simluate"},
+	{PK_TRANSACTION_FLAG_ENUM_SIMULATE,	"simulate"},
 	{PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD, "only-download"},
 	{0, NULL}
 };
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,