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

Richard Hughes hughsient at kemper.freedesktop.org
Mon Nov 26 15:17:28 PST 2007


 NEWS                                         |   52 +++++++++++++++++++++++++++
 backends/alpm/pk-backend-alpm.c              |   12 +++---
 configure.ac                                 |    2 -
 contrib/yum-packagekit/refresh-packagekit.py |    2 -
 html/pk-download.html                        |    1 
 python/pk-frontend-test.py                   |   17 ++++++++
 src/pk-engine.c                              |   37 ++++++++++++++++---
 src/pk-engine.h                              |    2 +
 src/pk-interface.xml                         |    2 +
 9 files changed, 115 insertions(+), 12 deletions(-)

New commits:
commit c90a593988928556189e1d7435088edb9e814e82
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 26 23:16:54 2007 +0000

    post release bump to 0.1.5

diff --git a/configure.ac b/configure.ac
index 747bfd2..a15e478 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 AC_PREREQ(2.52)
 
-AC_INIT(PackageKit, 0.1.4)
+AC_INIT(PackageKit, 0.1.5)
 AC_CONFIG_SRCDIR(src)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)
commit f6f4abd185232f67374b76d01d0684ddf4196f90
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 26 23:11:34 2007 +0000

    update download page

diff --git a/html/pk-download.html b/html/pk-download.html
index 5e483c0..18260ce 100644
--- a/html/pk-download.html
+++ b/html/pk-download.html
@@ -39,6 +39,7 @@ Released versions are found on
 <tr><td>0.1.1</td><td></td><td>2007-10-23</td></tr>
 <tr><td>0.1.2</td><td></td><td>2007-11-01</td></tr>
 <tr><td>0.1.3</td><td></td><td>2007-11-10</td></tr>
+<tr><td>0.1.4</td><td></td><td>2007-11-26</td></tr>
 </table>
 
 <h2>Dependencies</h2>
commit 8aa01e6686ca5477406657cfde8a08ed71c6118e
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 26 23:10:41 2007 +0000

    prepare for release

diff --git a/NEWS b/NEWS
index 94f796b..3402227 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,55 @@
+Version 0.1.4
+~~~~~~~~~~~~~
+
+* Backends:
+ - yum: Mark our status as QUERY when we have finished setting up the
+   transaction so we get the correct icon (Richard Hughes)
+ - yum: Improved yum UpdateMetadata handling for reboot-suggested (Luke Macken)
+ - conary: Add GetFiles (Elliot Peele)
+ - conary: Enable Cancel (Elliot Peele)
+ - conary: Add Resolve support (Elliot Peele)
+ - conary: Added new python files to distfiles (Ken VanDine)
+ - zypp: add initial backend code (Boyd Timothy, Scott Reeves)
+ - zypp: Add GetRepoList (Boyd Timothy)
+ - zypp: emit the correct status from the backend (Boyd Timothy)
+ - zypp: Add InstallPackage method (Boyd Timothy, Scott Reeves)
+ - zypp: Query SQL database to resolve names (Scott Reeves)
+ - box: set Status more often (Grzegorz Dabrowski)
+ - box: Remove all the shell helpers and use C implementations (Grzegorz Dabrowski)
+
+* New features:
+ - Lots more waf build system updates - it now builds and installs 100%
+   but requires waf from svn (Gustavo Carneiro, Daniel Svensson, Richard Hughes)
+ - Add the requires check before remove in pkcon (Richard Hughes)
+ - Monitor when the calling program exits from the system bus (Richard Hughes)
+ - waf: Add unit test reporting in waf buildsystem (Daniel Svensson)
+ - Convert all the active methods async. This lets us get the sender so we can
+   watch to see if they fall off the bus or not (Richard Hughes)
+ - Add a yum-packagekit plugin to refresh the PackageKit data when a manual
+   update command is run. Code is copied from yum-updatesd in yum-utils and
+   was authored by James Bowes.
+ - Install the bash completion file so it works by default (Richard Hughes)
+ - Add into pkcon to get the time since something was checked (Richard Hughes)
+ - Log when the last command is run so we can work out how long since a command
+   was run. This allows us to accuratly preseve the "session" setting of
+   GetUpdates policy (Richard Hughes)
+
+* API changes:
+ - Add a status enum so we get the correct icon when getting data (Richard Hughes)
+ - Add a info enum for blocked updates (Richard Hughes)
+ - Add some more status constants for backend transaction progress (Richard Hughes)
+ - Add messages to be shown from the transaction to the session (Richard Hughes)
+
+* Bugfixes:
+ - Use a different PolicyKit permissions for UpdateSystem and UpdatePackage
+   as both were defined as the same thing in the policy (Richard Hughes)
+ - Build fixes with autogen.sh (Tom Parker, Boyd Timothy)
+ - Free memory in case of dbus error (Grzegorz Dabrowski)
+ - Fix a crash in pk_transaction_list_get_array (JP Rosevear)
+ - We should only invalidate the internal cache if the transaction succeeded.
+   This stops a failed update-system from clearing the cache (Richard Hughes)
+ - Fix the manpage corruption issue described in Bug #12796 (Luke Macken)
+
 Version 0.1.3
 ~~~~~~~~~~~~~
 
commit 26519cd2286b982b41412ed22f212d0e859eb4a6
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 26 23:00:36 2007 +0000

    Add the StateHasChanged method so the yum plugin can signal the daemon that all is not well

diff --git a/contrib/yum-packagekit/refresh-packagekit.py b/contrib/yum-packagekit/refresh-packagekit.py
index 3f63c01..dcd1477 100644
--- a/contrib/yum-packagekit/refresh-packagekit.py
+++ b/contrib/yum-packagekit/refresh-packagekit.py
@@ -33,7 +33,7 @@ def posttrans_hook(conduit):
     try:
         packagekit_proxy = bus.get_object('org.freedesktop.PackageKit.yum', '/PackageKit')
         packagekit_iface = dbus.Interface(packagekit_proxy, 'org.freedesktop.PackageKit')
-        packagekit_iface.UpdatesHaveChanged()
+        packagekit_iface.StateHasChanged()
     except dbus.DBusException, e:
         conduit.info(2, "Unable to send message to PackageKit")
         conduit.info(6, "%s" %(e,))
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 678e3af..a9ef7e0 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -2575,6 +2575,28 @@ pk_engine_cancel (PkEngine *engine, const gchar *tid, GError **error)
 }
 
 /**
+ * pk_engine_state_has_changed:
+ *
+ * This should be called when tools like pup, pirut and yum-cli
+ * have finished their transaction, and the update cache may not be valid.
+ **/
+gboolean
+pk_engine_state_has_changed (PkEngine *engine, GError **error)
+{
+	g_return_val_if_fail (engine != NULL, FALSE);
+	g_return_val_if_fail (PK_IS_ENGINE (engine), FALSE);
+
+	if (engine->priv->updates_cache != NULL) {
+		pk_debug ("unreffing updates cache as state may have changed");
+		g_object_unref (engine->priv->updates_cache);
+		engine->priv->updates_cache = NULL;
+	}
+	pk_debug ("emitting updates-changed tid:%s", "unknown");
+	g_signal_emit (engine, signals [PK_ENGINE_UPDATES_CHANGED], 0, "unknown");
+	return TRUE;
+}
+
+/**
  * pk_engine_is_caller_active:
  **/
 gboolean
diff --git a/src/pk-engine.h b/src/pk-engine.h
index 5d7f7a8..8b3b3d8 100644
--- a/src/pk-engine.h
+++ b/src/pk-engine.h
@@ -200,6 +200,8 @@ gboolean	 pk_engine_is_caller_active		(PkEngine	*engine,
 							 gboolean	*is_active,
 							 GError		**error);
 guint		 pk_engine_get_seconds_idle		(PkEngine	*engine);
+gboolean	 pk_engine_state_has_changed		(PkEngine	*engine,
+							 GError		**error);
 
 gboolean	 pk_engine_get_progress			(PkEngine	*engine,
 							 const gchar	*tid,
diff --git a/src/pk-interface.xml b/src/pk-interface.xml
index 97128a1..8147a20 100644
--- a/src/pk-interface.xml
+++ b/src/pk-interface.xml
@@ -266,6 +266,8 @@
     </signal>
 
     <!-- General methods -->
+    <method name="StateHasChanged"> <!-- drop caches -->
+    </method>
     <method name="GetTimeSinceAction">
       <arg type="s" name="role" direction="in"/>
       <arg type="u" name="seconds" direction="out"/>
commit b10b566722f68cb3a9f77a57e47fdeba7f1de52f
Author: Tom Parker <palfrey at tevp.net>
Date:   Tue Nov 6 23:20:50 2007 +0100

    Add get_missing_actions to pk-frontend test

diff --git a/python/pk-frontend-test.py b/python/pk-frontend-test.py
index d90c022..0057f21 100755
--- a/python/pk-frontend-test.py
+++ b/python/pk-frontend-test.py
@@ -118,6 +118,15 @@ def get_actions(*args):
 	# Quit immediately because no job was scheduled
 	exit(0)
 
+def get_missing_actions(*args):
+	details = p.GetActions().split(";")
+	for x in PackageKitEnum.role:
+		if x not in details and x not in ["unknown"]:
+			print "  %s" % x
+
+	# Quit immediately because no job was scheduled
+	exit(0)
+
 def usage():
 	print "Usage: %s <command> <options>"%argv[0]
 	print "Valid commands are:"
commit 9fa3c5d30d32870e904c3a9c9938b3d36e4a759d
Author: Tom Parker <palfrey at tevp.net>
Date:   Tue Nov 6 20:01:08 2007 +0100

    Add get_actions to python test frontend

diff --git a/python/pk-frontend-test.py b/python/pk-frontend-test.py
index 25bd613..d90c022 100755
--- a/python/pk-frontend-test.py
+++ b/python/pk-frontend-test.py
@@ -110,6 +110,14 @@ def get_backend_detail(*args):
 	# Quit immediately because no job was scheduled
 	exit(0)
 
+def get_actions(*args):
+	details = p.GetActions().split(";")
+	for d in details:
+		print "  %s" % d
+
+	# Quit immediately because no job was scheduled
+	exit(0)
+
 def usage():
 	print "Usage: %s <command> <options>"%argv[0]
 	print "Valid commands are:"
commit 163a75183e6dae163ea1ea85a6a45221560109a4
Author: Andreas Obergrusberger <tradiaz at yahoo.de>
Date:   Sun Nov 25 14:50:13 2007 -0800

    fixed list bug in alpm

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 612b5c9..d583a30 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -153,6 +153,8 @@ my_list_mmerge (alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn)
 gboolean
 pkg_equal (pmpkg_t *p1, pmpkg_t *p2)
 {
+  /*pk_debug (alpm_pkg_get_name (p1));
+  pk_debug (alpm_pkg_get_name (p2));*/
   if (strcmp (alpm_pkg_get_name (p1), alpm_pkg_get_name (p2)) != 0)
     return FALSE;
   if (strcmp (alpm_pkg_get_version (p1), alpm_pkg_get_version (p2)) != 0)
@@ -182,7 +184,7 @@ my_list_remove_node (alpm_list_t *node)
   if(node->prev) {
     node->prev->next = node->next;
     ret = node->prev;
-    node->prev = NULL;
+    //node->prev = NULL;
   }
   if(node->next) {
     node->next->prev = node->prev;
@@ -279,8 +281,8 @@ find_packages ( const gchar *name, pmdb_t *db)
     }
 
   alpm_list_free (needle);
-  if (localresult != NULL)
-    alpm_list_free_inner (localresult, (alpm_list_fn_free)alpm_pkg_free);
+  if (localresult != NULL);
+    //alpm_list_free_inner (localresult, (alpm_list_fn_free)alpm_pkg_free);
   return result;
 }
 
commit 5edebb4a2b2618b5f4d68b291e676881af860e30
Author: Andreas Obergrusberger <tradiaz at yahoo.de>
Date:   Sun Nov 25 14:18:49 2007 -0800

    fixed alpm compilation

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 933ca52..612b5c9 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -368,7 +368,7 @@ backend_initialize (PkBackend *backend)
 	if (alpm_parse_config ("/etc/pacman.conf", NULL, "") != 0)
 	  {
 	    pk_backend_error_code (backend,
-				 PK_ERROR_ENUM_CONFIG_PARSING,
+				 PK_ERROR_ENUM_FAILED_CONFIG_PARSING,
 				 "Failed to parse config file");
 	    pk_debug ("alpm: %s", alpm_strerror (pm_errno));
 	    backend_destroy (backend);
@@ -379,7 +379,7 @@ backend_initialize (PkBackend *backend)
 	if (alpm_db_register ("local") == NULL)
 	  {
 	    pk_backend_error_code (backend,
-				 PK_ERROR_ENUM_CONFIG_PARSING,
+				 PK_ERROR_ENUM_FAILED_CONFIG_PARSING,
 				 "Failed to load local database");
 	    backend_destroy (backend);
 	    return;
commit 55adecc059f2277909fb8e122851d258a345f430
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Nov 24 10:25:09 2007 +0000

    don't save the package list unless the transaction will be shown in the viewer

diff --git a/src/pk-engine.c b/src/pk-engine.c
index e94e2ba..678e3af 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -617,12 +617,17 @@ pk_engine_finished_cb (PkBackend *backend, PkExitEnum exit, PkEngine *engine)
 	/* find the length of time we have been running */
 	time = pk_backend_get_runtime (backend);
 
-	/* add to the database */
-	packages = pk_package_list_get_string (item->package_list);
-	if (pk_strzero (packages) == FALSE) {
-		pk_transaction_db_set_data (engine->priv->transaction_db, item->tid, packages);
+	/* add to the database if we are going to log it */
+	if (role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
+	    role == PK_ROLE_ENUM_UPDATE_PACKAGE ||
+	    role == PK_ROLE_ENUM_INSTALL_PACKAGE ||
+	    role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
+		packages = pk_package_list_get_string (item->package_list);
+		if (pk_strzero (packages) == FALSE) {
+			pk_transaction_db_set_data (engine->priv->transaction_db, item->tid, packages);
+		}
+		g_free (packages);
 	}
-	g_free (packages);
 
 	pk_debug ("backend was running for %i ms", time);
 	pk_transaction_db_set_finished (engine->priv->transaction_db, item->tid, TRUE, time);



More information about the PackageKit mailing list