[packagekit] packagekit: Branch 'master' - 5 commits

Richard Hughes hughsient at kemper.freedesktop.org
Mon Sep 17 14:58:25 PDT 2007


 backends/box/pk-backend-box.c           |    9 +---
 backends/dummy/pk-backend-dummy.c       |    6 +-
 backends/test/pk-backend-test-fail.c    |    6 +-
 backends/test/pk-backend-test-succeed.c |   22 ++++++++-
 backends/yum/pk-backend-yum.c           |    6 +-
 libpackagekit/pk-task-client.c          |    8 +--
 libpackagekit/pk-task-client.h          |    2 
 libpackagekit/pk-task-monitor.c         |   38 +++++++++++++++--
 libpackagekit/pk-task-monitor.h         |    1 
 src/Makefile.am                         |    7 +++
 src/pk-backend-internal.h               |    8 +--
 src/pk-backend.c                        |   46 ++++++++++----------
 src/pk-engine.c                         |   71 +++++++++++++++++++++++++-------
 src/pk-engine.h                         |    9 ++--
 src/pk-interface.xml                    |   18 ++++++--
 src/pk-job-list.c                       |   61 ++++++++++++++++++++++-----
 src/pk-job-list.h                       |    1 
 src/pk-marshal.list                     |    1 
 src/pk-self-test.c                      |    2 
 src/pk-transaction-db.c                 |   69 ++++++++++++++++++++++---------
 20 files changed, 285 insertions(+), 106 deletions(-)

New commits:
diff-tree 4294e329cc299de63c2bcbcc34393b86e533543b (from 59faa6aeffc6f499f1312f937d7fff6b42304ad1)
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 17 22:20:08 2007 +0100

    Add GetOldTransactions API for the transaction viewer

diff --git a/src/pk-engine.c b/src/pk-engine.c
index 984eb4e..e0833bc 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -73,6 +73,7 @@ enum {
 	PK_ENGINE_SUB_PERCENTAGE_CHANGED,
 	PK_ENGINE_NO_PERCENTAGE_UPDATES,
 	PK_ENGINE_PACKAGE,
+	PK_ENGINE_TRANSACTION,
 	PK_ENGINE_ERROR_CODE,
 	PK_ENGINE_REQUIRE_RESTART,
 	PK_ENGINE_FINISHED,
@@ -1409,6 +1410,19 @@ pk_engine_get_package (PkEngine *engine,
 }
 
 /**
+ * pk_engine_get_old_transactions:
+ **/
+gboolean
+pk_engine_get_old_transactions (PkEngine *engine, guint number, GError **error)
+{
+	g_return_val_if_fail (engine != NULL, FALSE);
+	g_return_val_if_fail (PK_IS_ENGINE (engine), FALSE);
+
+	pk_debug ("get %i old transactions", number);
+	return pk_transaction_db_get_list (engine->priv->transaction_db, number);
+}
+
+/**
  * pk_engine_cancel:
  **/
 gboolean
@@ -1510,6 +1524,17 @@ pk_engine_get_filters (PkEngine *engine,
 }
 
 /**
+ * pk_engine_transaction_cb:
+ **/
+static void
+pk_engine_transaction_cb (PkTransactionDb *tdb, const gchar *tid, const gchar *timespec,
+			  gboolean succeeded, const gchar *role, guint duration, PkEngine *engine)
+{
+	pk_debug ("emitting transaction %s, %s, %i, %s, %i", tid, timespec, succeeded, role, duration);
+	g_signal_emit (engine, signals [PK_ENGINE_TRANSACTION], 0, tid, timespec, succeeded, role, duration);
+}
+
+/**
  * pk_engine_get_seconds_idle:
  * @engine: This class instance
  **/
@@ -1608,6 +1633,11 @@ pk_engine_class_init (PkEngineClass *kla
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
 			      0, NULL, NULL, pk_marshal_VOID__UINT_BOOL,
 			      G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_BOOLEAN);
+	signals [PK_ENGINE_TRANSACTION] =
+		g_signal_new ("transaction",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, pk_marshal_VOID__STRING_STRING_BOOL_STRING_UINT,
+			      G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT);
 
 	g_type_class_add_private (klass, sizeof (PkEnginePrivate));
 }
@@ -1625,10 +1655,14 @@ pk_engine_init (PkEngine *engine)
 
 	engine->priv = PK_ENGINE_GET_PRIVATE (engine);
 	engine->priv->job_list = pk_job_list_new ();
-	engine->priv->transaction_db = pk_transaction_db_new ();
 	engine->priv->timer = g_timer_new ();
 	engine->priv->backend = NULL;
 
+	/* we use a trasaction db to store old transactions and to do rollbacks */
+	engine->priv->transaction_db = pk_transaction_db_new ();
+	g_signal_connect (engine->priv->transaction_db, "transaction",
+			  G_CALLBACK (pk_engine_transaction_cb), engine);
+
 	/* get a connection to the bus */
 	dbus_error_init (&dbus_error);
 	engine->priv->connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error);
diff --git a/src/pk-engine.h b/src/pk-engine.h
index 2df26dd..9dec041 100644
--- a/src/pk-engine.h
+++ b/src/pk-engine.h
@@ -171,6 +171,9 @@ gboolean	 pk_engine_get_package			(PkEng
 							 guint		 job,
 							 gchar		**package,
 							 GError		**error);
+gboolean	 pk_engine_get_old_transactions		(PkEngine	*engine,
+							 guint		 number,
+							 GError		**error);
 
 G_END_DECLS
 
diff --git a/src/pk-interface.xml b/src/pk-interface.xml
index 9ea98ae..c69894e 100644
--- a/src/pk-interface.xml
+++ b/src/pk-interface.xml
@@ -166,6 +166,18 @@
       <arg type="au" name="jobs" direction="out"/>
     </signal>
 
+    <!-- Transaction methods -->
+    <method name="GetOldTransactions">
+      <arg type="u" name="number" direction="in"/>
+    </method>
+    <signal name="Transaction">
+      <arg type="s" name="tid" direction="out"/>
+      <arg type="s" name="timespec" direction="out"/>
+      <arg type="b" name="succeeded" direction="out"/>
+      <arg type="s" name="role" direction="out"/>
+      <arg type="u" name="duration" direction="out"/>
+    </signal>
+
     <!-- General methods -->
     <method name="GetActions">
       <arg type="s" name="actions" direction="out"/> <!-- list of supported actions -->
diff --git a/src/pk-marshal.list b/src/pk-marshal.list
index 14d2733..f91dd23 100644
--- a/src/pk-marshal.list
+++ b/src/pk-marshal.list
@@ -14,4 +14,5 @@ VOID:STRING,STRING,STRING,STRING,STRING,
 VOID:STRING,STRING,UINT,STRING,STRING
 VOID:STRING,UINT,STRING,STRING
 VOID:STRING,STRING,UINT,UINT,UINT
+VOID:STRING,STRING,BOOL,STRING,UINT
 
diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index 30eb88c..569bcd0 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -61,12 +61,46 @@ static guint signals [PK_TRANSACTION_DB_
 
 G_DEFINE_TYPE (PkTransactionDb, pk_transaction_db, G_TYPE_OBJECT)
 
+typedef struct {
+	gboolean succeeded;
+	guint duration;
+	PkRoleEnum role;
+	gchar *tid;
+	gchar *timespec;
+} PkTransactionDbItem;
+
+/**
+ * pk_transaction_db_item_clear:
+ **/
+static gboolean
+pk_transaction_db_item_clear (PkTransactionDbItem *item)
+{
+	item->succeeded = FALSE;
+	item->duration = 0;
+	item->role = PK_ROLE_ENUM_UNKNOWN;
+	item->tid = NULL;
+	item->timespec = NULL;
+	return TRUE;
+}
+
+/**
+ * pk_transaction_db_item_free:
+ **/
+static gboolean
+pk_transaction_db_item_free (PkTransactionDbItem *item)
+{
+	g_free (item->tid);
+	g_free (item->timespec);
+	return TRUE;
+}
+
 /**
  * pk_transaction_sqlite_callback:
  **/
 static gint
 pk_transaction_sqlite_callback (void *data, gint argc, gchar **argv, gchar **col_name)
 {
+	PkTransactionDbItem item;
 	PkTransactionDb *tdb = PK_TRANSACTION_DB (data);
 	gint i;
 	gchar *col;
@@ -75,50 +109,45 @@ pk_transaction_sqlite_callback (void *da
 	g_return_val_if_fail (tdb != NULL, 0);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), 0);
 
-	gboolean succeeded = FALSE;
-	guint duration = 0;
-	PkRoleEnum role = PK_ROLE_ENUM_UNKNOWN;
-	gchar *tid = NULL;
-	gchar *timespec = NULL;
+	pk_transaction_db_item_clear (&item);
 
 	for (i=0; i<argc; i++) {
 		col = col_name[i];
 		value = argv[i];
 		if (strcmp (col, "succeeded") == 0) {
-			succeeded = atoi (value);
+			item.succeeded = atoi (value);
 		} else if (strcmp (col, "role") == 0) {
 			if (value != NULL) {
-				role = pk_role_enum_from_text (value);
+				item.role = pk_role_enum_from_text (value);
 			}
 		} else if (strcmp (col, "transaction_id") == 0) {
 			if (value != NULL) {
-				tid = g_strdup (value);
+				item.tid = g_strdup (value);
 			}
 		} else if (strcmp (col, "timespec") == 0) {
 			if (value != NULL) {
-				timespec = g_strdup (value);
+				item.timespec = g_strdup (value);
 			}
 		} else if (strcmp (col, "duration") == 0) {
 			if (value != NULL) {
-				duration = atoi (value);
+				item.duration = atoi (value);
 			}
 		} else {
 			pk_warning ("%s = %s\n", col, value);
 		}
 	}
 
-	g_print ("tid          : %s\n", tid);
-	g_print (" timespec    : %s\n", timespec);
-	g_print (" succeeded   : %i\n", succeeded);
-	g_print (" role        : %s\n", pk_role_enum_to_text (role));
-	g_print (" duration    : %i (seconds)\n", duration);
+	g_print ("tid          : %s\n", item.tid);
+	g_print (" timespec    : %s\n", item.timespec);
+	g_print (" succeeded   : %i\n", item.succeeded);
+	g_print (" role        : %s\n", pk_role_enum_to_text (item.role));
+	g_print (" duration    : %i (seconds)\n", item.duration);
 
 	/* emit signal */
 	g_signal_emit (tdb, signals [PK_TRANSACTION_DB_TRANSACTION], 0,
-		       tid, timespec, succeeded, role, duration);
+		       item.tid, item.timespec, item.succeeded, pk_role_enum_to_text (item.role), item.duration);
 
-	g_free (tid);
-	g_free (timespec);
+	pk_transaction_db_item_free (&item);
 	return 0;
 }
 
@@ -258,8 +287,8 @@ pk_transaction_db_class_init (PkTransact
 	signals [PK_TRANSACTION_DB_TRANSACTION] =
 		g_signal_new ("transaction",
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, pk_marshal_VOID__STRING_STRING_UINT_UINT_UINT,
-			      G_TYPE_NONE, 0);
+			      0, NULL, NULL, pk_marshal_VOID__STRING_STRING_BOOL_STRING_UINT,
+			      G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT);
 	g_type_class_add_private (klass, sizeof (PkTransactionDbPrivate));
 }
 
diff-tree 59faa6aeffc6f499f1312f937d7fff6b42304ad1 (from f643d71f321a5326cd88c820f847e0c0aa5df77e)
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 17 21:23:59 2007 +0100

    allow the monitoring class to cancel the job

diff --git a/libpackagekit/pk-task-monitor.c b/libpackagekit/pk-task-monitor.c
index 699f2dc..f642d6f 100644
--- a/libpackagekit/pk-task-monitor.c
+++ b/libpackagekit/pk-task-monitor.c
@@ -157,6 +157,36 @@ pk_task_monitor_get_package (PkTaskMonit
 }
 
 /**
+ * pk_task_monitor_cancel:
+ **/
+gboolean
+pk_task_monitor_cancel (PkTaskMonitor *tmonitor)
+{
+	gboolean ret;
+	GError *error;
+
+	g_return_val_if_fail (tmonitor != NULL, FALSE);
+	g_return_val_if_fail (PK_IS_TASK_MONITOR (tmonitor), FALSE);
+	g_return_val_if_fail (tmonitor->priv->job != 0, FALSE);
+
+	error = NULL;
+	ret = dbus_g_proxy_call (tmonitor->priv->proxy, "Cancel", &error,
+				 G_TYPE_UINT, tmonitor->priv->job,
+				 G_TYPE_INVALID,
+				 G_TYPE_INVALID);
+	if (error) {
+		pk_debug ("ERROR: %s", error->message);
+		g_error_free (error);
+	}
+	if (ret == FALSE) {
+		/* abort as the DBUS method failed */
+		pk_warning ("Cancel failed!");
+		return FALSE;
+	}
+	return TRUE;
+}
+
+/**
  * pk_task_monitor_get_percentage:
  **/
 gboolean
diff --git a/libpackagekit/pk-task-monitor.h b/libpackagekit/pk-task-monitor.h
index 2a63915..23e8a0c 100644
--- a/libpackagekit/pk-task-monitor.h
+++ b/libpackagekit/pk-task-monitor.h
@@ -64,6 +64,7 @@ gboolean	 pk_task_monitor_get_sub_percen
 							 guint		*percentage);
 gboolean	 pk_task_monitor_get_package		(PkTaskMonitor	*tmonitor,
 							 gchar		**package_id);
+gboolean	 pk_task_monitor_cancel			(PkTaskMonitor	*tmonitor);
 
 G_END_DECLS
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 66e722b..cbedf63 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -110,15 +110,22 @@ check_PROGRAMS =					\
 	pk-self-test
 
 pk_self_test_SOURCES =					\
+	pk-backend.h					\
+	pk-backend.c					\
 	pk-spawn.h					\
 	pk-spawn.c					\
+	pk-network.h					\
+	pk-network.c					\
 	pk-thread-list.h				\
 	pk-thread-list.c				\
+	pk-job-list.h					\
+	pk-job-list.c					\
 	pk-self-test.c					\
 	$(NULL)
 
 pk_self_test_LDADD =					\
 	$(GLIB_LIBS)					\
+	$(GMODULE_LIBS)					\
 	$(DBUS_LIBS)					\
 	$(SELFTEST_LIBS)				\
 	$(LIBNM_LIBS)					\
diff --git a/src/pk-backend-internal.h b/src/pk-backend-internal.h
index c48cf70..c6d8761 100644
--- a/src/pk-backend-internal.h
+++ b/src/pk-backend-internal.h
@@ -95,9 +95,9 @@ gboolean	 pk_backend_search_name			(PkBa
 gboolean	 pk_backend_update_package		(PkBackend	*backend,
 							 const gchar	*package_id);
 gboolean	 pk_backend_update_system		(PkBackend	*backend);
-gboolean	 pk_backend_get_status		(PkBackend	*backend,
+gboolean	 pk_backend_get_status			(PkBackend	*backend,
 							 PkStatusEnum	*status);
-gboolean	 pk_backend_get_role		(PkBackend	*backend,
+gboolean	 pk_backend_get_role			(PkBackend	*backend,
 							 PkRoleEnum	*role,
 							 const gchar	**package_id);
 gboolean	 pk_backend_get_percentage		(PkBackend	*backend,
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 9e79ffb..984eb4e 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -396,6 +396,7 @@ pk_engine_finished_cb (PkTask *task, PkE
 	time = pk_backend_get_runtime (task);
 
 	pk_debug ("task was running for %f seconds", time);
+	pk_transaction_db_set_finished (engine->priv->transaction_db, item->tid, TRUE, time);
 
 	pk_debug ("emitting finished job: %i, '%s', %i", item->job, exit_text, (guint) time);
 	g_signal_emit (engine, signals [PK_ENGINE_FINISHED], 0, item->job, exit_text, (guint) time);
@@ -490,18 +491,24 @@ pk_engine_new_task (PkEngine *engine)
 static gboolean
 pk_engine_add_task (PkEngine *engine, PkTask *task)
 {
+	PkRoleEnum role;
+	PkJobListItem *item;
+
 	g_return_val_if_fail (engine != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_ENGINE (engine), FALSE);
 
 	/* commit, so it appears in the JobList */
 	pk_job_list_commit (engine->priv->job_list, task);
 
-#if 0
+	/* get all the data we know */
+	item = pk_job_list_get_item_from_task (engine->priv->job_list, task);
+
 	/* add to database */
-	pk_transaction_db_add (engine->priv->transaction_db, "45;mom;data");
-	pk_transaction_db_set_role (engine->priv->transaction_db, "45;mom;data", PK_ROLE_ENUM_SYSTEM_UPDATE);
-	pk_transaction_db_set_finished (engine->priv->transaction_db, "45;mom;data", 1, 123);
-#endif
+	pk_transaction_db_add (engine->priv->transaction_db, item->tid);
+
+	/* save role in the database */
+	pk_backend_get_role (task, &role, NULL);
+	pk_transaction_db_set_role (engine->priv->transaction_db, item->tid, role);
 
 	/* emit a signal */
 	pk_engine_job_list_changed (engine);
diff --git a/src/pk-job-list.c b/src/pk-job-list.c
index d985262..e7834cc 100644
--- a/src/pk-job-list.c
+++ b/src/pk-job-list.c
@@ -129,9 +129,49 @@ pk_job_list_role_present (PkJobList *job
 }
 
 /**
+ * pk_job_list_tid_get_random_hex_string:
+ **/
+static gchar *
+pk_job_list_tid_get_random_hex_string (guint length)
+{
+	GRand *rand;
+	gint32 num;
+	gchar *string;
+	guint i;
+
+	rand = g_rand_new ();
+
+	/* allocate a string with the correct size */
+	string = g_strnfill (length, 'x');
+	for (i=0; i<length; i++) {
+		num = g_rand_int_range (rand, (gint32) 'a', (gint32) 'f');
+		/* assign a random number as a char */
+		string[i] = (gchar) num;
+	}
+	g_rand_free (rand);
+	return string;
+}
+
+/**
+ * pk_job_list_tid_id_generate:
+ **/
+gchar *
+pk_job_list_tid_id_generate (void)
+{
+	gchar *random;
+	gchar *job;
+	gchar *tid;
+	random = pk_job_list_tid_get_random_hex_string (8);
+	job = g_strdup_printf ("%i", 0);
+	tid = g_strjoin (";", job, random, "data", NULL);
+	g_free (random);
+	g_free (job);
+	return tid;
+}
+
+/**
  * pk_job_list_add:
  **/
- /* create transaction_id, add to array, mark changed */
 PkJobListItem *
 pk_job_list_add (PkJobList *job_list, PkTask *task)
 {
@@ -148,6 +188,7 @@ pk_job_list_add (PkJobList *job_list, Pk
 	item->valid = FALSE;
 	item->task = task;
 	item->job = job_list->priv->job_count;
+	item->tid = pk_job_list_tid_id_generate ();
 	g_ptr_array_add (job_list->priv->array, item);
 
 	/* in an ideal world we don't need this, but do it in case the daemon is ctrl-c;d */
@@ -170,6 +211,7 @@ pk_job_list_remove (PkJobList *job_list,
 		return FALSE;
 	}
 	g_ptr_array_remove (job_list->priv->array, item);
+	g_free (item->tid);
 	g_free (item);
 	return TRUE;
 }
@@ -355,13 +397,11 @@ pk_job_list_new (void)
 #ifdef PK_BUILD_TESTS
 #include <libselftest.h>
 
-static GMainLoop *loop;
-
 void
 libst_job_list (LibSelfTest *test)
 {
 	PkJobList *job_list;
-	gboolean ret;
+	gchar *tid;
 
 	if (libst_start (test, "PkJobList", CLASS_AUTO) == FALSE) {
 		return;
@@ -370,13 +410,14 @@ libst_job_list (LibSelfTest *test)
 	job_list = pk_job_list_new ();
 
 	/************************************************************/
-	libst_title (test, "make sure return error for missing file");
-	ret = pk_job_list_foo (job_list, " ");
-	if (ret == FALSE) {
-		libst_success (test, "failed to run invalid file");
+	libst_title (test, "make sure we get a valid tid");
+	tid = pk_job_list_tid_id_generate ();
+	if (tid != NULL) {
+		libst_success (test, "got tid %s", tid);
 	} else {
-		libst_failed (test, "ran incorrect file");
+		libst_failed (test, "failed to get tid");
 	}
+	g_free (tid);
 
 	g_object_unref (job_list);
 
diff --git a/src/pk-job-list.h b/src/pk-job-list.h
index 576a0b0..bd7a855 100644
--- a/src/pk-job-list.h
+++ b/src/pk-job-list.h
@@ -53,6 +53,7 @@ typedef struct {
 	guint		 job;
 	gboolean	 valid;
 	PkTask		*task;
+	gchar		*tid;
 } PkJobListItem;
 
 GType		 pk_job_list_get_type		  	(void);
diff --git a/src/pk-self-test.c b/src/pk-self-test.c
index 9fa6c6a..4a98a54 100644
--- a/src/pk-self-test.c
+++ b/src/pk-self-test.c
@@ -27,6 +27,7 @@
 /* prototypes */
 void libst_spawn (LibSelfTest *test);
 void libst_thread_list (LibSelfTest *test);
+void libst_job_list (LibSelfTest *test);
 
 int
 main (int argc, char **argv)
@@ -43,6 +44,7 @@ main (int argc, char **argv)
 	/* tests go here */
 	libst_spawn (&test);
 	libst_thread_list (&test);
+	libst_job_list (&test);
 
 	return (libst_finish (&test));
 }
diff-tree f643d71f321a5326cd88c820f847e0c0aa5df77e (from 87f5323c2885bc58dcb190a6f71d9e8f34abad01)
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 17 21:23:22 2007 +0100

    add a super long running task for debugging

diff --git a/backends/test/pk-backend-test-succeed.c b/backends/test/pk-backend-test-succeed.c
index f049317..590da00 100644
--- a/backends/test/pk-backend-test-succeed.c
+++ b/backends/test/pk-backend-test-succeed.c
@@ -191,13 +191,27 @@ backend_search_group (PkBackend *backend
 }
 
 /**
+ * backend_search_name_timeout:
+ **/
+gboolean
+backend_search_name_timeout (gpointer data)
+{
+	PkBackend *backend = (PkBackend *) data;
+	pk_backend_finished (backend);
+	return FALSE;
+}
+
+/**
  * backend_search_name:
+ *
+ * A really long wait........
  */
 static void
 backend_search_name (PkBackend *backend, const gchar *filter, const gchar *search)
 {
 	g_return_if_fail (backend != NULL);
-	pk_backend_finished (backend);
+	pk_backend_no_percentage_updates (backend);
+	g_timeout_add (200000, backend_search_name_timeout, backend);
 }
 
 /**
diff-tree 87f5323c2885bc58dcb190a6f71d9e8f34abad01 (from a98169b112e22a6e2b7c89dbf1a3b088aa9de492)
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 17 17:12:00 2007 +0100

    make some api method names more sane

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index d843522..a3af3c5 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -74,10 +74,10 @@ backend_get_filters (PkBackend *backend,
 }
 
 /**
- * backend_cancel_job_try:
+ * backend_cancel:
  */
 static void
-backend_cancel_job_try (PkBackend *backend)
+backend_cancel (PkBackend *backend)
 {
 	g_return_if_fail (backend != NULL);
 }
@@ -318,7 +318,7 @@ PK_BACKEND_OPTIONS (
 	backend_destroy,			/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	backend_cancel_job_try,			/* cancel_job_try */
+	backend_cancel,			/* cancel_job_try */
 	backend_get_depends,			/* get_depends */
 	backend_get_description,		/* get_description */
 	backend_get_requires,			/* get_requires */
diff --git a/backends/test/pk-backend-test-fail.c b/backends/test/pk-backend-test-fail.c
index 45c6d0a..219ea92 100644
--- a/backends/test/pk-backend-test-fail.c
+++ b/backends/test/pk-backend-test-fail.c
@@ -53,10 +53,10 @@ backend_get_filters (PkBackend *backend,
 }
 
 /**
- * backend_cancel_job_try:
+ * backend_cancel:
  */
 static void
-backend_cancel_job_try (PkBackend *backend)
+backend_cancel (PkBackend *backend)
 {
 	g_return_if_fail (backend != NULL);
 	pk_backend_finished (backend);
@@ -210,7 +210,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	backend_cancel_job_try,			/* cancel_job_try */
+	backend_cancel,			/* cancel_job_try */
 	backend_get_depends,			/* get_depends */
 	backend_get_description,		/* get_description */
 	backend_get_requires,			/* get_requires */
diff --git a/backends/test/pk-backend-test-succeed.c b/backends/test/pk-backend-test-succeed.c
index c9d2c3a..f049317 100644
--- a/backends/test/pk-backend-test-succeed.c
+++ b/backends/test/pk-backend-test-succeed.c
@@ -71,10 +71,10 @@ backend_get_filters (PkBackend *backend,
 }
 
 /**
- * backend_cancel_job_try:
+ * backend_cancel:
  */
 static void
-backend_cancel_job_try (PkBackend *backend)
+backend_cancel (PkBackend *backend)
 {
 	g_return_if_fail (backend != NULL);
 	pk_backend_finished (backend);
@@ -228,7 +228,7 @@ PK_BACKEND_OPTIONS (
 	backend_destroy,			/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	backend_cancel_job_try,			/* cancel_job_try */
+	backend_cancel,			/* cancel_job_try */
 	backend_get_depends,			/* get_depends */
 	backend_get_description,		/* get_description */
 	backend_get_requires,			/* get_requires */
diff --git a/backends/yum/pk-backend-yum.c b/backends/yum/pk-backend-yum.c
index f9190a0..6d13146 100644
--- a/backends/yum/pk-backend-yum.c
+++ b/backends/yum/pk-backend-yum.c
@@ -53,10 +53,10 @@ backend_get_filters (PkBackend *backend,
 }
 
 /**
- * backend_cancel_job_try:
+ * backend_cancel:
  */
 static void
-backend_cancel_job_try (PkBackend *backend)
+backend_cancel (PkBackend *backend)
 {
 	g_return_if_fail (backend != NULL);
 	/* this feels bad... */
@@ -233,7 +233,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	backend_cancel_job_try,			/* cancel_job_try */
+	backend_cancel,			/* cancel_job_try */
 	backend_get_depends,			/* get_depends */
 	backend_get_description,		/* get_description */
 	backend_get_requires,			/* get_requires */
diff --git a/libpackagekit/pk-task-client.c b/libpackagekit/pk-task-client.c
index 3b97db7..ea3609f 100644
--- a/libpackagekit/pk-task-client.c
+++ b/libpackagekit/pk-task-client.c
@@ -878,10 +878,10 @@ pk_task_client_install_package (PkTaskCl
 }
 
 /**
- * pk_task_client_cancel_job_try:
+ * pk_task_client_cancel:
  **/
 gboolean
-pk_task_client_cancel_job_try (PkTaskClient *tclient)
+pk_task_client_cancel (PkTaskClient *tclient)
 {
 	gboolean ret;
 	GError *error;
@@ -896,13 +896,13 @@ pk_task_client_cancel_job_try (PkTaskCli
 	}
 
 	error = NULL;
-	ret = dbus_g_proxy_call (tclient->priv->proxy, "CancelJobTry", &error,
+	ret = dbus_g_proxy_call (tclient->priv->proxy, "Cancel", &error,
 				 G_TYPE_UINT, tclient->priv->job,
 				 G_TYPE_INVALID,
 				 G_TYPE_INVALID);
 	if (ret == FALSE) {
 		/* abort as the DBUS method failed */
-		pk_warning ("CancelJobTry failed :%s", error->message);
+		pk_warning ("Cancel failed :%s", error->message);
 		g_error_free (error);
 	}
 	return ret;
diff --git a/libpackagekit/pk-task-client.h b/libpackagekit/pk-task-client.h
index 5d0d4a4..d4fbd7a 100644
--- a/libpackagekit/pk-task-client.h
+++ b/libpackagekit/pk-task-client.h
@@ -98,7 +98,7 @@ gboolean	 pk_task_client_refresh_cache		
 							 gboolean	 force);
 gboolean	 pk_task_client_install_package		(PkTaskClient	*tclient,
 							 const gchar	*package_id);
-gboolean	 pk_task_client_cancel_job_try		(PkTaskClient	*tclient);
+gboolean	 pk_task_client_cancel		(PkTaskClient	*tclient);
 PkEnumList	*pk_task_client_get_actions		(PkTaskClient	*tclient);
 PkEnumList	*pk_task_client_get_filters		(PkTaskClient	*tclient);
 PkEnumList	*pk_task_client_get_groups		(PkTaskClient	*tclient);
diff --git a/libpackagekit/pk-task-monitor.c b/libpackagekit/pk-task-monitor.c
index a46f53f..699f2dc 100644
--- a/libpackagekit/pk-task-monitor.c
+++ b/libpackagekit/pk-task-monitor.c
@@ -106,7 +106,7 @@ pk_task_monitor_get_status (PkTaskMonito
 	g_return_val_if_fail (tmonitor->priv->job != 0, FALSE);
 
 	error = NULL;
-	ret = dbus_g_proxy_call (tmonitor->priv->proxy, "GetJobStatus", &error,
+	ret = dbus_g_proxy_call (tmonitor->priv->proxy, "GetStatus", &error,
 				 G_TYPE_UINT, tmonitor->priv->job,
 				 G_TYPE_INVALID,
 				 G_TYPE_STRING, &status_text,
@@ -117,7 +117,7 @@ pk_task_monitor_get_status (PkTaskMonito
 	}
 	if (ret == FALSE) {
 		/* abort as the DBUS method failed */
-		pk_warning ("GetJobStatus failed!");
+		pk_warning ("GetStatus failed!");
 		return FALSE;
 	}
 	*status = pk_status_enum_from_text (status_text);
@@ -237,7 +237,7 @@ pk_task_monitor_get_role (PkTaskMonitor 
 	g_return_val_if_fail (tmonitor->priv->job != 0, FALSE);
 
 	error = NULL;
-	ret = dbus_g_proxy_call (tmonitor->priv->proxy, "GetJobRole", &error,
+	ret = dbus_g_proxy_call (tmonitor->priv->proxy, "GetRole", &error,
 				 G_TYPE_UINT, tmonitor->priv->job,
 				 G_TYPE_INVALID,
 				 G_TYPE_STRING, &role_text,
@@ -245,7 +245,7 @@ pk_task_monitor_get_role (PkTaskMonitor 
 				 G_TYPE_INVALID);
 	if (ret == FALSE) {
 		/* abort as the DBUS method failed */
-		pk_warning ("GetJobRole failed :%s", error->message);
+		pk_warning ("GetRole failed :%s", error->message);
 		g_error_free (error);
 		return FALSE;
 	}
diff --git a/src/pk-backend-internal.h b/src/pk-backend-internal.h
index 76b1e5d..c48cf70 100644
--- a/src/pk-backend-internal.h
+++ b/src/pk-backend-internal.h
@@ -63,7 +63,7 @@ gboolean	 pk_backend_load			(PkBackend  
 							 const gchar	*name);
 gboolean	 pk_backend_unload			(PkBackend      *backend);
 const gchar	*pk_backend_get_name			(PkBackend	*backend);
-gboolean	 pk_backend_cancel_job_try		(PkBackend	*backend);
+gboolean	 pk_backend_cancel		(PkBackend	*backend);
 gboolean	 pk_backend_get_depends			(PkBackend	*backend,
 							 const gchar	*package_id);
 gboolean	 pk_backend_get_update_detail		(PkBackend	*backend,
@@ -95,9 +95,9 @@ gboolean	 pk_backend_search_name			(PkBa
 gboolean	 pk_backend_update_package		(PkBackend	*backend,
 							 const gchar	*package_id);
 gboolean	 pk_backend_update_system		(PkBackend	*backend);
-gboolean	 pk_backend_get_job_status		(PkBackend	*backend,
+gboolean	 pk_backend_get_status		(PkBackend	*backend,
 							 PkStatusEnum	*status);
-gboolean	 pk_backend_get_job_role		(PkBackend	*backend,
+gboolean	 pk_backend_get_role		(PkBackend	*backend,
 							 PkRoleEnum	*role,
 							 const gchar	**package_id);
 gboolean	 pk_backend_get_percentage		(PkBackend	*backend,
@@ -108,7 +108,7 @@ gboolean	 pk_backend_get_package			(PkBa
 							 gchar		**package_id);
 
 /* these are external in nature, but we shouldn't be using them in helpers */
-gboolean	 pk_backend_set_job_role		(PkBackend	*backend,
+gboolean	 pk_backend_set_role		(PkBackend	*backend,
 							 PkRoleEnum	 role,
 							 const gchar	*package_id);
 gboolean	 pk_backend_not_implemented_yet		(PkBackend	*backend,
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 338d0c3..1a8f0bf 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -554,10 +554,10 @@ pk_backend_change_sub_percentage (PkBack
 }
 
 /**
- * pk_backend_set_job_role:
+ * pk_backend_set_role:
  **/
 gboolean
-pk_backend_set_job_role (PkBackend *backend, PkRoleEnum role, const gchar *package_id)
+pk_backend_set_role (PkBackend *backend, PkRoleEnum role, const gchar *package_id)
 {
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
@@ -735,10 +735,10 @@ pk_backend_error_code (PkBackend *backen
 }
 
 /**
- * pk_backend_get_job_status:
+ * pk_backend_get_status:
  **/
 gboolean
-pk_backend_get_job_status (PkBackend *backend, PkStatusEnum *status)
+pk_backend_get_status (PkBackend *backend, PkStatusEnum *status)
 {
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
@@ -753,10 +753,10 @@ pk_backend_get_job_status (PkBackend *ba
 }
 
 /**
- * pk_backend_get_job_role:
+ * pk_backend_get_role:
  **/
 gboolean
-pk_backend_get_job_role (PkBackend *backend, PkRoleEnum *role, const gchar **package_id)
+pk_backend_get_role (PkBackend *backend, PkRoleEnum *role, const gchar **package_id)
 {
 	g_return_val_if_fail (backend != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
@@ -851,14 +851,14 @@ pk_backend_allow_interrupt (PkBackend *b
 
 
 /**
- * pk_backend_cancel_job_try:
+ * pk_backend_cancel:
  */
 gboolean
-pk_backend_cancel_job_try (PkBackend *backend)
+pk_backend_cancel (PkBackend *backend)
 {
 	g_return_val_if_fail (backend != NULL, FALSE);
 	if (backend->desc->cancel_job_try == NULL) {
-		pk_backend_not_implemented_yet (backend, "CancelJobTry");
+		pk_backend_not_implemented_yet (backend, "Cancel");
 		return FALSE;
 	}
 	/* check to see if we have an action */
@@ -890,7 +890,7 @@ pk_backend_get_depends (PkBackend *backe
 		pk_backend_not_implemented_yet (backend, "GetDepends");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, package_id);
 	backend->desc->get_depends (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -907,7 +907,7 @@ pk_backend_get_update_detail (PkBackend 
 		pk_backend_not_implemented_yet (backend, "GetUpdateDetail");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, package_id);
 	backend->desc->get_update_detail (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -924,7 +924,7 @@ pk_backend_get_description (PkBackend *b
 		pk_backend_not_implemented_yet (backend, "GetDescription");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, package_id);
 	backend->desc->get_description (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -941,7 +941,7 @@ pk_backend_get_requires (PkBackend *back
 		pk_backend_not_implemented_yet (backend, "GetRequires");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, package_id);
 	backend->desc->get_requires (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -958,7 +958,7 @@ pk_backend_get_updates (PkBackend *backe
 		pk_backend_not_implemented_yet (backend, "GetUpdates");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, NULL);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, NULL);
 	backend->desc->get_updates (backend);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -975,7 +975,7 @@ pk_backend_install_package (PkBackend *b
 		pk_backend_not_implemented_yet (backend, "InstallPackage");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_PACKAGE_INSTALL, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_PACKAGE_INSTALL, package_id);
 	backend->desc->install_package (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -992,7 +992,7 @@ pk_backend_refresh_cache (PkBackend *bac
 		pk_backend_not_implemented_yet (backend, "RefreshCache");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_REFRESH_CACHE, NULL);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_REFRESH_CACHE, NULL);
 	backend->desc->refresh_cache (backend, force);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1009,7 +1009,7 @@ pk_backend_remove_package (PkBackend *ba
 		pk_backend_not_implemented_yet (backend, "RemovePackage");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_PACKAGE_REMOVE, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_PACKAGE_REMOVE, package_id);
 	backend->desc->remove_package (backend, package_id, allow_deps);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1026,7 +1026,7 @@ pk_backend_search_details (PkBackend *ba
 		pk_backend_not_implemented_yet (backend, "SearchDetails");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, search);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, search);
 	backend->desc->search_details (backend, filter, search);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1043,7 +1043,7 @@ pk_backend_search_file (PkBackend *backe
 		pk_backend_not_implemented_yet (backend, "SearchFile");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, search);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, search);
 	backend->desc->search_file (backend, filter, search);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1060,7 +1060,7 @@ pk_backend_search_group (PkBackend *back
 		pk_backend_not_implemented_yet (backend, "SearchGroup");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, search);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, search);
 	backend->desc->search_group (backend, filter, search);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1077,7 +1077,7 @@ pk_backend_search_name (PkBackend *backe
 		pk_backend_not_implemented_yet (backend, "SearchName");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_QUERY, search);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_QUERY, search);
 	backend->desc->search_name (backend, filter, search);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1094,7 +1094,7 @@ pk_backend_update_package (PkBackend *ba
 		pk_backend_not_implemented_yet (backend, "UpdatePackage");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_PACKAGE_UPDATE, package_id);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_PACKAGE_UPDATE, package_id);
 	backend->desc->update_package (backend, package_id);
 	backend->priv->assigned = TRUE;
 	return TRUE;
@@ -1111,7 +1111,7 @@ pk_backend_update_system (PkBackend *bac
 		pk_backend_not_implemented_yet (backend, "UpdateSystem");
 		return FALSE;
 	}
-	pk_backend_set_job_role (backend, PK_ROLE_ENUM_SYSTEM_UPDATE, NULL);
+	pk_backend_set_role (backend, PK_ROLE_ENUM_SYSTEM_UPDATE, NULL);
 	backend->desc->update_system (backend);
 	backend->priv->assigned = TRUE;
 	return TRUE;
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 7f8b76b..9e79ffb 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1271,10 +1271,10 @@ pk_engine_get_job_list (PkEngine *engine
 }
 
 /**
- * pk_engine_get_job_status:
+ * pk_engine_get_status:
  **/
 gboolean
-pk_engine_get_job_status (PkEngine *engine, guint job,
+pk_engine_get_status (PkEngine *engine, guint job,
 			  const gchar **status, GError **error)
 {
 	PkStatusEnum status_enum;
@@ -1289,17 +1289,17 @@ pk_engine_get_job_status (PkEngine *engi
 			     "No job:%i", job);
 		return FALSE;
 	}
-	pk_backend_get_job_status (item->task, &status_enum);
+	pk_backend_get_status (item->task, &status_enum);
 	*status = g_strdup (pk_status_enum_to_text (status_enum));
 
 	return TRUE;
 }
 
 /**
- * pk_engine_get_job_role:
+ * pk_engine_get_role:
  **/
 gboolean
-pk_engine_get_job_role (PkEngine *engine, guint job,
+pk_engine_get_role (PkEngine *engine, guint job,
 			const gchar **role, const gchar **package_id, GError **error)
 {
 	PkJobListItem *item;
@@ -1314,7 +1314,7 @@ pk_engine_get_job_role (PkEngine *engine
 			     "No job:%i", job);
 		return FALSE;
 	}
-	pk_backend_get_job_role (item->task, &role_enum, package_id);
+	pk_backend_get_role (item->task, &role_enum, package_id);
 	*role = g_strdup (pk_role_enum_to_text (role_enum));
 
 	return TRUE;
@@ -1402,10 +1402,10 @@ pk_engine_get_package (PkEngine *engine,
 }
 
 /**
- * pk_engine_cancel_job_try:
+ * pk_engine_cancel:
  **/
 gboolean
-pk_engine_cancel_job_try (PkEngine *engine, guint job, GError **error)
+pk_engine_cancel (PkEngine *engine, guint job, GError **error)
 {
 	gboolean ret;
 	PkJobListItem *item;
@@ -1420,7 +1420,7 @@ pk_engine_cancel_job_try (PkEngine *engi
 		return FALSE;
 	}
 
-	ret = pk_backend_cancel_job_try (item->task);
+	ret = pk_backend_cancel (item->task);
 	if (ret == FALSE) {
 		g_set_error (error, PK_ENGINE_ERROR, PK_ENGINE_ERROR_NOT_SUPPORTED,
 			     "Operation not yet supported by backend");
diff --git a/src/pk-engine.h b/src/pk-engine.h
index 107c62c..2df26dd 100644
--- a/src/pk-engine.h
+++ b/src/pk-engine.h
@@ -136,16 +136,16 @@ void		 pk_engine_update_package		(PkEngi
 gboolean	 pk_engine_get_job_list			(PkEngine	*engine,
 							 GArray		**job_list,
 							 GError		**error);
-gboolean	 pk_engine_get_job_status		(PkEngine	*engine,
+gboolean	 pk_engine_get_status		(PkEngine	*engine,
 							 guint		 job,
 							 const gchar	**status,
 							 GError		**error);
-gboolean	 pk_engine_get_job_role			(PkEngine	*engine,
+gboolean	 pk_engine_get_role			(PkEngine	*engine,
 							 guint		 job,
 							 const gchar	**status,
 							 const gchar	**package_id,
 							 GError		**error);
-gboolean	 pk_engine_cancel_job_try		(PkEngine	*engine,
+gboolean	 pk_engine_cancel		(PkEngine	*engine,
 							 guint		 job,
 							 GError		**error);
 gboolean	 pk_engine_get_actions			(PkEngine	*engine,
diff --git a/src/pk-interface.xml b/src/pk-interface.xml
index 6091215..9ea98ae 100644
--- a/src/pk-interface.xml
+++ b/src/pk-interface.xml
@@ -127,16 +127,16 @@
     </signal>
 
     <!-- Do things or query jobs -->
-    <method name="CancelJobTry"> <!-- might not succeed for all manner or reasons -->
+    <method name="Cancel"> <!-- might not succeed for all manner or reasons -->
       <!-- throws NoSuchJob -->
       <arg type="u" name="job" direction="in"/>
     </method>
-    <method name="GetJobStatus"> <!-- this is what the job is currrently doing, and might change -->
+    <method name="GetStatus"> <!-- this is what the job is currrently doing, and might change -->
       <!-- throws NoSuchJob -->
       <arg type="u" name="job" direction="in"/>
       <arg type="s" name="status" direction="out"/> <!-- query,download,install,exit -->
     </method>
-    <method name="GetJobRole"> <!-- this is the master role, i.e. won't change for the lifetime of the job -->
+    <method name="GetRole"> <!-- this is the master role, i.e. won't change for the lifetime of the job -->
       <!-- throws NoSuchJob -->
       <arg type="u" name="job" direction="in"/>
       <arg type="s" name="status" direction="out"/> <!-- query,download,install,exit -->
diff --git a/src/pk-job-list.c b/src/pk-job-list.c
index e4ad202..d985262 100644
--- a/src/pk-job-list.c
+++ b/src/pk-job-list.c
@@ -120,7 +120,7 @@ pk_job_list_role_present (PkJobList *job
 	length = job_list->priv->array->len;
 	for (i=0; i<length; i++) {
 		item = (PkJobListItem *) g_ptr_array_index (job_list->priv->array, i);
-		pk_backend_get_job_role (item->task, &role_temp, NULL);
+		pk_backend_get_role (item->task, &role_temp, NULL);
 		if (role_temp == role) {
 			return TRUE;
 		}
diff-tree a98169b112e22a6e2b7c89dbf1a3b088aa9de492 (from b031d7f0c8f271ce1ea86915df4f50447231effd)
Author: Grzegorz Dabrowski <gdx at o2.pl>
Date:   Mon Sep 17 18:06:53 2007 +0000

    [box] fixed compillation, don't call pk_backend_finished from thread directly

diff --git a/backends/box/pk-backend-box.c b/backends/box/pk-backend-box.c
index 7919c4c..7787eb9 100644
--- a/backends/box/pk-backend-box.c
+++ b/backends/box/pk-backend-box.c
@@ -164,11 +164,9 @@ find_packages_real (PkBackend *backend, 
 		list = box_db_repos_search_file (db, search);
 		add_packages_from_list (backend, list);
 		box_db_repos_package_list_free (list);
-		pk_backend_finished (backend);
 	} else {
 		if (installed == FALSE && available == FALSE) {
 			pk_backend_error_code (backend, PK_ERROR_ENUM_UNKNOWN, "invalid search mode");
-			pk_backend_finished (backend);
 		} else	{
 			if (installed == TRUE && available == TRUE) {
 				list = box_db_repos_packages_search_all(db, (gchar *)search, search_filter);
@@ -179,7 +177,6 @@ find_packages_real (PkBackend *backend, 
 			}
 			add_packages_from_list (backend, list);
 			box_db_repos_package_list_free (list);
-			pk_backend_finished (backend);
 		}
 	}
 
@@ -191,7 +188,7 @@ backend_find_packages_thread (PkBackend 
 {
 	FindData *d = (FindData*) data;
 
-	g_return_val_if_fail (backend != NULL, NULL);
+	g_return_val_if_fail (backend != NULL, FALSE);
 
 	find_packages_real (backend, d->search, d->filter, d->mode);
 
@@ -379,7 +376,7 @@ backend_install_package (PkBackend *back
 	/* check network state */
 	if (pk_backend_network_is_online (backend) == FALSE) {
 		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
-		pk_backend_finished (backend, PK_EXIT_ENUM_FAILED);
+		pk_backend_finished (backend);
 		return;
 	}
 	pk_backend_spawn_helper (backend, "install-package.sh", package_id, NULL);
@@ -459,7 +456,7 @@ backend_update_package (PkBackend *backe
 	/* check network state */
 	if (pk_backend_network_is_online (backend) == FALSE) {
 		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot update when offline");
-		pk_backend_finished (backend, PK_EXIT_ENUM_FAILED);
+		pk_backend_finished (backend);
 		return;
 	}
 	pk_backend_spawn_helper (backend, "update-package.sh", package_id, NULL);



More information about the PackageKit mailing list