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

Richard Hughes hughsient at kemper.freedesktop.org
Tue Sep 25 13:36:48 PDT 2007


 TODO                                     |   10 ----------
 backends/conary/helpers/conaryBackend.py |    6 +++---
 backends/conary/pk-backend-conary.c      |    4 ++--
 client/pk-console.c                      |    6 ++++--
 libpackagekit/pk-client.c                |   10 ++++++----
 src/pk-engine.c                          |   12 ++++++++----
 src/pk-marshal.list                      |    2 +-
 src/pk-transaction-db.c                  |    6 +++---
 8 files changed, 27 insertions(+), 29 deletions(-)

New commits:
diff-tree a6cf9cb051d9e8f3ff6c32b6818087627b989ec8 (from 8b867e92a9a693d649478a1c4ec1c0354064348c)
Author: Ken VanDine <ken at vandine.org>
Date:   Tue Sep 25 15:28:29 2007 -0400

    We really have get_requires not get_depends

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 10a5d3a..98eaa6c 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -198,10 +198,10 @@ class PackageKitConaryBackend(PackageKit
     def search_details(self, opt, key):
         pass
 
-    def get_depends(self, package_id):
+    def get_requires(self, package_id):
         pass
 
-    def get_requires(self, package_id):
+    def get_depends(self, package_id):
         name, version, flavor, installed = self._findPackage(package_id)
 
         if name:
@@ -209,7 +209,7 @@ class PackageKitConaryBackend(PackageKit
                 self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
                     'Package already installed')
 
-            updJob, suggMap = self._do_pacakge_update(name, version, flavor,
+            updJob, suggMap = self._do_package_update(name, version, flavor,
                                                       apply=False)
 
             for what, need in suggMap:
diff-tree 8b867e92a9a693d649478a1c4ec1c0354064348c (from b835a548be6e349b9f0b20d889724393474971bd)
Author: Ken VanDine <ken at vandine.org>
Date:   Tue Sep 25 15:27:50 2007 -0400

    Updated filters, filter on just installed

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index dffd5ef..70c770a 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -48,8 +48,8 @@ backend_get_filters (PkBackend *backend,
 	g_return_if_fail (backend != NULL);
 	pk_enum_list_append_multiple (elist,
 				      /* PK_FILTER_ENUM_GUI, */
-				      /* PK_FILTER_ENUM_INSTALLED, */
-				      PK_FILTER_ENUM_DEVELOPMENT,
+				      PK_FILTER_ENUM_INSTALLED,
+				      /* PK_FILTER_ENUM_DEVELOPMENT, */
 				      -1);
 }
 
diff-tree b835a548be6e349b9f0b20d889724393474971bd (from f33a6d41368d82350cad5b62a817628af21a2dba)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Sep 25 19:50:48 2007 +0100

    convert a transaction role conversion i missed

diff --git a/src/pk-engine.c b/src/pk-engine.c
index 053cbd6..965721c 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1794,11 +1794,15 @@ pk_engine_get_filters (PkEngine *engine,
  **/
 static void
 pk_engine_transaction_cb (PkTransactionDb *tdb, const gchar *old_tid, const gchar *timespec,
-			  gboolean succeeded, const gchar *role, guint duration, PkEngine *engine)
+			  gboolean succeeded, PkRoleEnum role, guint duration, PkEngine *engine)
 {
-	const gchar *tid = engine->priv->sync_item->tid;
-	pk_debug ("emitting transaction %s, %s, %s, %i, %s, %i", tid, old_tid, timespec, succeeded, role, duration);
-	g_signal_emit (engine, signals [PK_ENGINE_TRANSACTION], 0, tid, old_tid, timespec, succeeded, role, duration);
+	const gchar *role_text;
+	const gchar *tid;
+
+	tid = engine->priv->sync_item->tid;
+	role_text = pk_role_enum_to_text (role);
+	pk_debug ("emitting transaction %s, %s, %s, %i, %s, %i", tid, old_tid, timespec, succeeded, role_text, duration);
+	g_signal_emit (engine, signals [PK_ENGINE_TRANSACTION], 0, tid, old_tid, timespec, succeeded, role_text, duration);
 }
 
 /**
diff-tree f33a6d41368d82350cad5b62a817628af21a2dba (from c159de635aed991684c1dbf5299ed2ecdf623e50)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Sep 25 18:44:24 2007 +0100

    turn the transaction role into an enumerated type internally

diff --git a/TODO b/TODO
index 647b139..6d3fb58 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,5 @@
 Order of no particular importance:
 
-*** API Changes ***
-s/GetOldTransactions/GetTransactionDetails
-
 *** Have to have an UpdatesChanged signal ***
 For the icon to update after we've done a system upgrade
 NOTE: RELEASE BLOCKER
@@ -20,10 +17,6 @@ We need a way to get the installed files
 We need a way to work out how long something is going to take, and
 to expose in the UI.
 
-*** Get Transactions ***
-Do we use a job number? Finished?
-Need to convert the role to an enum
-
 *** task_client has to return GError ***
 Client programs using libpackagekit should know the error, rather than just
 "it failed"
@@ -31,9 +24,6 @@ Client programs using libpackagekit shou
 *** Log what was installed/removed and when ***
 Need to monitor the Package's emitted by the task and encoded to a string
 
-*** Dummy backend should use subpercent and install deps ***
-It's not a great test case right now...
-
 *** Handle rollbacks for select backends ***
 To do rollbacks sanely in PK we need a few things:
  * write an application that can see the description of the transactions
diff --git a/client/pk-console.c b/client/pk-console.c
index 4714f29..08d04d5 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -102,12 +102,14 @@ pk_console_package_cb (PkClient *client,
  **/
 static void
 pk_console_transaction_cb (PkClient *client, const gchar *tid, const gchar *timespec,
-			   gboolean succeeded, const gchar *role, guint duration, gpointer data)
+			   gboolean succeeded, PkRoleEnum role, guint duration, gpointer data)
 {
+	const gchar *role_text;
+	role_text = pk_role_enum_to_text (role);
 	g_print ("tid          : %s\n", tid);
 	g_print (" timespec    : %s\n", timespec);
 	g_print (" succeeded   : %i\n", succeeded);
-	g_print (" role        : %s\n", role /*pk_role_enum_to_text (role)*/);
+	g_print (" role        : %s\n", role_text);
 	g_print (" duration    : %i (seconds)\n", duration);
 }
 
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 5dfafcc..7ccc3e1 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -358,14 +358,16 @@ pk_client_package_cb (DBusGProxy   *prox
 static void
 pk_client_transaction_cb (DBusGProxy *proxy,
 			  const gchar *tid, const gchar *old_tid, const gchar *timespec,
-			  gboolean succeeded, const gchar *role, guint duration,
+			  gboolean succeeded, const gchar *role_text, guint duration,
 			  PkClient *client)
 {
+	PkRoleEnum role;
 	g_return_if_fail (client != NULL);
 	g_return_if_fail (PK_IS_CLIENT (client));
 
 	if (pk_transaction_id_equal (tid, client->priv->tid) == TRUE) {
-		pk_debug ("emitting transaction %s, %s, %i, %s, %i", old_tid, timespec, succeeded, role, duration);
+		role = pk_role_enum_from_text (role_text);
+		pk_debug ("emitting transaction %s, %s, %i, %s, %i", old_tid, timespec, succeeded, role_text, duration);
 		g_signal_emit (client, signals [PK_CLIENT_TRANSACTION], 0, tid, timespec, succeeded, role, duration);
 	}
 }
@@ -1578,8 +1580,8 @@ pk_client_class_init (PkClientClass *kla
 	signals [PK_CLIENT_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);
+			      0, NULL, NULL, pk_marshal_VOID__STRING_STRING_BOOL_UINT_UINT,
+			      G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_UINT);
 	signals [PK_CLIENT_UPDATE_DETAIL] =
 		g_signal_new ("update-detail",
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
diff --git a/src/pk-marshal.list b/src/pk-marshal.list
index ba07221..53ea3cd 100644
--- a/src/pk-marshal.list
+++ b/src/pk-marshal.list
@@ -15,6 +15,6 @@ 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
+VOID:STRING,STRING,BOOL,UINT,UINT
 VOID:STRING,STRING,STRING,BOOL,STRING,UINT
 
diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index 11002fd..1f9bead 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -145,7 +145,7 @@ pk_transaction_sqlite_callback (void *da
 
 	/* emit signal */
 	g_signal_emit (tdb, signals [PK_TRANSACTION_DB_TRANSACTION], 0,
-		       item.tid, item.timespec, item.succeeded, pk_role_enum_to_text (item.role), item.duration);
+		       item.tid, item.timespec, item.succeeded, item.role, item.duration);
 
 	pk_transaction_db_item_free (&item);
 	return 0;
@@ -287,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_BOOL_STRING_UINT,
-			      G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT);
+			      0, NULL, NULL, pk_marshal_VOID__STRING_STRING_BOOL_UINT_UINT,
+			      G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_UINT);
 	g_type_class_add_private (klass, sizeof (PkTransactionDbPrivate));
 }
 



More information about the PackageKit mailing list