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

Richard Hughes hughsient at kemper.freedesktop.org
Tue Mar 25 15:03:43 PDT 2008


 backends/conary/helpers/search-details.py |    4 
 backends/dummy/pk-backend-dummy.c         |    3 
 backends/poldek/pk-backend-poldek.c       |   33 +++
 backends/smart/pk-backend-smart.c         |  271 +++++++++++++++++++++++++++---
 backends/test/helpers/search-name.sh      |   16 -
 backends/yum2/helpers/yumDBUSBackend.py   |  166 +++++++++++-------
 backends/zypp/pk-backend-zypp.cpp         |   16 -
 backends/zypp/zypp-events.h               |   10 -
 client/pk-import-desktop.c                |   41 +++-
 data/tests/pk-spawn-test-profiling.sh     |    6 
 data/tests/pk-spawn-test-sigquit.sh       |   22 +-
 data/tests/pk-spawn-test.sh               |   22 +-
 docs/html/img/pk-application-groups.png   |binary
 docs/html/img/pk-application-search.png   |binary
 docs/html/img/pk-updates-overview.png     |binary
 docs/spec/pk-backend-spawn.xml            |   14 -
 docs/spec/pk-concepts.xml                 |   73 +++++++-
 libpackagekit/pk-client.c                 |  114 ++++++++++++
 libpackagekit/pk-enum.c                   |   11 -
 libpackagekit/pk-enum.h                   |   28 ++-
 python/packagekit/backend.py              |   20 +-
 src/pk-backend-spawn.c                    |   20 --
 src/pk-backend.c                          |   52 +++++
 src/pk-backend.h                          |    8 
 src/pk-spawn.c                            |   45 ----
 25 files changed, 760 insertions(+), 235 deletions(-)

New commits:
commit 6a5061e9927c4cf4b4eccfbff556c5c10cf7ce20
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Tue Mar 25 10:48:50 2008 -0400

    smart: get the C file compiling again

diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 7b1557b..834efa0 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  *
  * Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
- * Copyright (C) 2007 James Bowes <jbowes at redhat.com>
+ * Copyright (C) 2008 James Bowes <jbowes at redhat.com>
  *
  * Licensed under the GNU General Public License Version 2
  *
@@ -21,37 +21,270 @@
  */
 
 
+#include <pk-network.h>
 #include <pk-backend.h>
-#include <pk-backend-python.h>
+#include <pk-backend-spawn.h>
+#include <pk-package-ids.h>
+
+static PkBackendSpawn *spawn;
+static PkNetwork *network;
+
+/**
+ * backend_initialize:
+ * This should only be run once per backend load, i.e. not every transaction
+ */
+static void
+backend_initialize (PkBackend *backend)
+{
+	g_return_if_fail (backend != NULL);
+	pk_debug ("FILTER: initialize");
+	network = pk_network_new ();
+	spawn = pk_backend_spawn_new ();
+	pk_backend_spawn_set_name (spawn, "smart");
+}
+
+/**
+ * backend_destroy:
+ * This should only be run once per backend load, i.e. not every transaction
+ */
+static void
+backend_destroy (PkBackend *backend)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_debug ("FILTER: destroy");
+	g_object_unref (network);
+	g_object_unref (spawn);
+}
+
+/**
+ * backend_get_depends:
+ */
+static void
+backend_get_depends (PkBackend *backend, const gchar *filter, const gchar *package_id, gboolean recursive)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	/* FIXME: Use recursive and filter here */
+	pk_backend_spawn_helper (spawn, "get-depends.py", package_id, NULL);
+}
+
+/**
+ * backend_get_description:
+ */
+static void
+backend_get_description (PkBackend *backend, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "get-description.py", package_id, NULL);
+}
+
+/**
+ * backend_get_files:
+ */
+static void
+backend_get_files (PkBackend *backend, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "get-files.py", package_id, NULL);
+}
+
+/**
+ * backend_get_updates:
+ */
+static void
+backend_get_updates (PkBackend *backend, const gchar *filter)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "get-updates.py", filter, NULL);
+}
+
+/**
+ * backend_install_package:
+ */
+static void
+backend_install_package (PkBackend *backend, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+
+	/* check network state */
+	if (pk_network_is_online (network) == FALSE) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
+		pk_backend_finished (backend);
+		return;
+	}
+
+	pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+}
+
+/**
+ * backend_install_file:
+ */
+static void
+backend_install_file (PkBackend *backend, const gchar *full_path)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "install-file.py", full_path, NULL);
+}
+
+/**
+ * backend_refresh_cache:
+ */
+static void
+backend_refresh_cache (PkBackend *backend, gboolean force)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+
+	/* check network state */
+	if (pk_network_is_online (network) == FALSE) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
+		pk_backend_finished (backend);
+		return;
+	}
+
+	pk_backend_spawn_helper (spawn, "refresh-cache.py", NULL);
+}
+
+/**
+ * pk_backend_remove_package:
+ */
+static void
+backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	/* FIXME: Use allow_deps and autoremove */
+	pk_backend_spawn_helper (spawn, "remove.py", package_id, NULL);
+}
+
+/**
+ * pk_backend_resolve:
+ */
+static void
+backend_resolve (PkBackend *backend, const gchar *filter, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "resolve.py", filter, package_id, NULL);
+}
+
+/**
+ * pk_backend_search_details:
+ */
+static void
+backend_search_details (PkBackend *backend, const gchar *filter, const gchar *search)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "search-details.py", filter, search, NULL);
+}
+
+/**
+ * pk_backend_search_name:
+ */
+static void
+backend_search_name (PkBackend *backend, const gchar *filter, const gchar *search)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "search-name.py", filter, search, NULL);
+}
+
+/**
+ * pk_backend_update_packages:
+ */
+static void
+backend_update_packages (PkBackend *backend, gchar **package_ids)
+{
+	gchar *package_ids_temp;
+
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+
+	/* check network state */
+	if (pk_network_is_online (network) == FALSE) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
+		pk_backend_finished (backend);
+		return;
+	}
+
+	/* send the complete list as stdin */
+	package_ids_temp = pk_package_ids_to_text (package_ids, " ");
+	pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
+	g_free (package_ids_temp);
+}
+
+/**
+ * pk_backend_update_system:
+ */
+static void
+backend_update_system (PkBackend *backend)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "update-system.py", NULL);
+}
+
+/**
+ * pk_backend_get_repo_list:
+ */
+static void
+backend_get_repo_list (PkBackend *backend)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	pk_backend_spawn_helper (spawn, "get-repo-list.py", NULL);
+}
+
+/**
+ * pk_backend_repo_enable:
+ */
+static void
+backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
+{
+	g_return_if_fail (backend != NULL);
+	g_return_if_fail (spawn != NULL);
+	if (enabled == TRUE) {
+		pk_backend_spawn_helper (spawn, "repo-enable.py", rid, "true", NULL);
+	} else {
+		pk_backend_spawn_helper (spawn, "repo-enable.py", rid, "false", NULL);
+	}
+}
 
 PK_BACKEND_OPTIONS (
 	"SMART",					/* description */
 	"James Bowes <jbowes at dangerouslyinc.com>",	/* author */
-	NULL,						/* initialize */
-	NULL,						/* destroy */
+	backend_initialize,				/* initialize */
+	backend_destroy,				/* destroy */
 	NULL,						/* get_groups */
 	NULL,						/* get_filters */
 	NULL,						/* cancel */
-	pk_backend_python_get_depends,			/* get_depends */
-	pk_backend_python_get_description,		/* get_description */
-	pk_backend_python_get_files,			/* get_files */
+	backend_get_depends,				/* get_depends */
+	backend_get_description,			/* get_description */
+	backend_get_files,				/* get_files */
 	NULL,						/* get_requires */
 	NULL,						/* get_update_detail */
-	pk_backend_python_get_updates,			/* get_updates */
-	pk_backend_python_install_package,		/* install_package */
-	pk_backend_python_install_file,			/* install_file */
-	pk_backend_python_refresh_cache,		/* refresh_cache */
-	pk_backend_python_remove_package,		/* remove_package */
-	pk_backend_python_resolve,			/* resolve */
+	backend_get_updates,				/* get_updates */
+	backend_install_package,			/* install_package */
+	backend_install_file,				/* install_file */
+	backend_refresh_cache,				/* refresh_cache */
+	backend_remove_package,				/* remove_package */
+	backend_resolve,				/* resolve */
 	NULL,						/* rollback */
-	pk_backend_python_search_details,		/* search_details */
+	backend_search_details,				/* search_details */
 	NULL,						/* search_file */
 	NULL,						/* search_group */
-	pk_backend_python_search_name,			/* search_name */
-	pk_backend_python_update_package,		/* update_package */
-	pk_backend_python_update_system,		/* update_system */
-	pk_backend_python_get_repo_list,		/* get_repo_list */
-	pk_backend_python_repo_enable,			/* repo_enable */
+	backend_search_name,				/* search_name */
+	backend_update_packages,			/* update_packages */
+	backend_update_system,				/* update_system */
+	backend_get_repo_list,				/* get_repo_list */
+	backend_repo_enable,				/* repo_enable */
 	NULL,						/* repo_set_data */
 	NULL,						/* service_pack */
 	NULL						/* what_provides */
commit d996e5d1df1efb8f9d8d7f19c8ce67e0495e3621
Merge: c414873... 542f451...
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Mar 25 16:01:52 2008 -0400

    Merge branch 'master' of git+ssh://rnorwood@git.packagekit.org/srv/git/PackageKit

commit c4148738e04d4bfb48210911412e9d65bd7be6db
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Mar 25 15:57:40 2008 -0400

    Reset progress bar before each action so percentage feedback is correct

diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 1d8c3ab..40642ae 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -325,6 +325,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 # Methods ( client -> engine -> backend )
 #
 
+    @threaded
+    @async
     def doInit(self):
         print "Now in doInit()"
         # yumbase is defined outside of this class so the sigquit handler can close the DB.
@@ -334,6 +336,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self._setup_yum()
         print "yum set up"
 
+    @threaded
+    @async
     def doExit(self):
         if self.locked:
             self._unlock_yum()
@@ -1885,7 +1889,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
     def _check_init(self):
         ''' Check if yum has setup, else call init '''
         if hasattr(self,'yumbase'):
-            pass
+            self.dnlCallback.reset()
         else:
             self.doInit()
 
@@ -1929,11 +1933,15 @@ class DownloadCallback( BaseMeter ):
         self.totSize = ""
         self.base = base
         self.showNames = showNames
+        self.reset()
+
+    def reset(self):
+        '''Reset download callback for a new transaction.'''
         self.oldName = None
         self.lastPct = 0
         self.totalPct = 0
         self.pkgs = None
-        self.numPkgs=0
+        self.numPkgs = 0
         self.bump = 0.0
 
     def setPackages(self,pkgs,startPct,numPct):
commit 542f4519a51c7e4036e044e8b5e5922363750c97
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 18:54:12 2008 +0000

    remove the stderr path as the two streams sometimes get unsynronised

diff --git a/backends/conary/helpers/search-details.py b/backends/conary/helpers/search-details.py
index f11fb0e..36958a0 100755
--- a/backends/conary/helpers/search-details.py
+++ b/backends/conary/helpers/search-details.py
@@ -25,7 +25,7 @@ affinityDb = client.db
 options = sys.argv[1]
 searchterms = sys.argv[2]
 
-sys.stderr.write('no-percentage-updates\n')
+sys.stdout.write('no-percentage-updates\n')
 
 try:
     localInstall = db.findTrove(None, (searchterms, None, None))
@@ -78,4 +78,4 @@ try:
         if do_print == 1:
             print "package\t%s\t%s\t%s" % (installed, package_id, summary)
 except:
-    sys.stderr.write('error\tinternal-error\tAn internal error has occurred')
+    sys.stdout.write('error\tinternal-error\tAn internal error has occurred')
diff --git a/backends/test/helpers/search-name.sh b/backends/test/helpers/search-name.sh
index c5b5640..58ace84 100755
--- a/backends/test/helpers/search-name.sh
+++ b/backends/test/helpers/search-name.sh
@@ -9,17 +9,17 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-echo -e "no-percentage-updates" > /dev/stderr
+echo -e "no-percentage-updates"
 sleep 1
-echo -e "percentage\t10" > /dev/stderr
-echo -e "status	query" > /dev/stderr
+echo -e "percentage\t10"
+echo -e "status\tquery"
 sleep 1
-echo -e "percentage\t30" > /dev/stderr
-echo -e "package	available	glib2;2.14.0;i386;fedora	The GLib library"
+echo -e "percentage\t30"
+echo -e "package\tavailable\tglib2;2.14.0;i386;fedora\tThe GLib library"
 sleep 1
-echo -e "percentage\t70" > /dev/stderr
-echo -e "package	installed	gtk2;gtk2-2.11.6-6.fc8;i386;fedora	GTK+ Libraries for GIMP"
+echo -e "percentage\t70"
+echo -e "package\tinstalled\tgtk2;gtk2-2.11.6-6.fc8;i386;fedora\tGTK+ Libraries for GIMP"
 sleep 1
-echo -e "percentage\t100" > /dev/stderr
+echo -e "percentage\t100"
 exit 0
 
diff --git a/data/tests/pk-spawn-test-profiling.sh b/data/tests/pk-spawn-test-profiling.sh
index ace475d..424a48e 100755
--- a/data/tests/pk-spawn-test-profiling.sh
+++ b/data/tests/pk-spawn-test-profiling.sh
@@ -10,9 +10,9 @@ time=0.01
 
 for i in `seq 1 100`
 do
-	echo -e "percentage\t$i" > /dev/stderr
-	echo -e "package:1\tpolkit\tPolicyKit daemon"
-	echo -e "package:0\tpolkit-gnome\tPolicyKit helper for GNOME"
+	echo -e "percentage\t$i"
+	echo -e "package:availabletpolkit\tPolicyKit daemon"
+	echo -e "package:installed\tpolkit-gnome\tPolicyKit helper for GNOME"
 	sleep ${time}
 done
 
diff --git a/data/tests/pk-spawn-test-sigquit.sh b/data/tests/pk-spawn-test-sigquit.sh
index c593d6d..cb8995d 100755
--- a/data/tests/pk-spawn-test-sigquit.sh
+++ b/data/tests/pk-spawn-test-sigquit.sh
@@ -17,26 +17,26 @@ trap_quit ()
 time=0.30
 
 echo "Locking!"
-echo -e "percentage\t0" > /dev/stderr
+echo -e "percentage\t0"
 sleep ${time}
-echo -e "percentage\t10" > /dev/stderr
+echo -e "percentage\t10"
 sleep ${time}
-echo -e "percentage\t20" > /dev/stderr
+echo -e "percentage\t20"
 sleep ${time}
-echo -e "percentage\t30" > /dev/stderr
+echo -e "percentage\t30"
 sleep ${time}
-echo -e "percentage\t40" > /dev/stderr
+echo -e "percentage\t40"
 sleep ${time}
-echo -e "percentage\t50" > /dev/stderr
+echo -e "percentage\t50"
 sleep ${time}
-echo -e "percentage\t60" > /dev/stderr
+echo -e "percentage\t60"
 sleep ${time}
-echo -e "percentage\t70" > /dev/stderr
+echo -e "percentage\t70"
 sleep ${time}
-echo -e "percentage\t80" > /dev/stderr
+echo -e "percentage\t80"
 sleep ${time}
-echo -e "percentage\t90" > /dev/stderr
+echo -e "percentage\t90"
 sleep ${time}
-echo -e "percentage\t100" > /dev/stderr
+echo -e "percentage\t100"
 echo "Unlocking!"
 
diff --git a/data/tests/pk-spawn-test.sh b/data/tests/pk-spawn-test.sh
index dfba273..67f0c7a 100755
--- a/data/tests/pk-spawn-test.sh
+++ b/data/tests/pk-spawn-test.sh
@@ -8,14 +8,14 @@
 
 time=0.30
 
-echo -e "percentage\t0" > /dev/stderr
-echo -e "percentage\t10" > /dev/stderr
+echo -e "percentage\t0"
+echo -e "percentage\t10"
 sleep ${time}
-echo -e "percentage\t20" > /dev/stderr
+echo -e "percentage\t20"
 sleep ${time}
-echo -e "percentage\t30" > /dev/stderr
+echo -e "percentage\t30"
 sleep ${time}
-echo -e "percentage\t40" > /dev/stderr
+echo -e "percentage\t40"
 sleep ${time}
 echo -e "package\tavailable\tpolkit;0.0.1;i386;data\tPolicyKit daemon"
 echo -e "package\tinstalled\tpolkit-gnome;0.0.1;i386;data\tPolicyKit helper for GNOME"
@@ -23,16 +23,16 @@ sleep ${time}
 echo -e -n "package\tavailable\tConsoleKit"
 sleep ${time}
 echo -e "\tSystem console checker"
-echo -e "percentage\t50" > /dev/stderr
+echo -e "percentage\t50"
 sleep ${time}
-echo -e "percentage\t60" > /dev/stderr
+echo -e "percentage\t60"
 sleep ${time}
-echo -e "percentage\t70" > /dev/stderr
+echo -e "percentage\t70"
 sleep ${time}
-echo -e "percentage\t80" > /dev/stderr
+echo -e "percentage\t80"
 sleep ${time}
-echo -e "percentage\t90" > /dev/stderr
+echo -e "percentage\t90"
 echo -e "package\tinstalled\tgnome-power-manager;0.0.1;i386;data\tMore useless software"
 sleep ${time}
-echo -e "percentage\t100" > /dev/stderr
+echo -e "percentage\t100"
 
diff --git a/docs/spec/pk-backend-spawn.xml b/docs/spec/pk-backend-spawn.xml
index 0a58cc5..842661d 100644
--- a/docs/spec/pk-backend-spawn.xml
+++ b/docs/spec/pk-backend-spawn.xml
@@ -30,15 +30,15 @@
   </itemizedlist>
   <para>
     Backends are typically open-programmable, which means we can define a
-    standard for what goes on stdin, stdout and stderr to try and maximise
+    standard for what goes on stdin and stdout to try and maximise
     the common code between the backends.
     The following section will explain the convention used on
     <literal>backends/conary</literal> and <literal>backends/yum</literal>.
   </para>
   <para>
     If you are unable to write scripts that conform to these specifications
-    then just launch a PkSpawn object in the compiled helper with stdout and
-    stderr callbacks and then try to do screenscraping in the backend.
+    then just launch a PkSpawn object in the compiled helper with stdout
+    callbacks and then try to do screenscraping in the backend.
     This screenscraping is least popular for obvious reasons.
   </para>
   <para>
@@ -162,44 +162,36 @@
           <row>
             <entry>Method</entry>
             <entry>Data</entry>
-            <entry>File</entry>
           </row>
         </thead>
         <tbody>
           <row>
             <entry>Percentage</entry>
             <entry><literal>percentage[tab]value</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>Subpercentage</entry>
             <entry><literal>subpercentage[tab]value</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>NoPercentageUpdates</entry>
             <entry><literal>no-percentage-updates</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>Error</entry>
             <entry><literal>error[tab]enum[tab]description</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>Status</entry>
             <entry><literal>status[tab]state</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>RequireRestart</entry>
             <entry><literal>requirerestart[tab]type[tab]details</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>AllowUpdate</entry>
             <entry><literal>allow-cancel[tab]enabled</literal></entry>
-            <entry><literal>stderr</literal></entry>
           </row>
           <row>
             <entry>Package</entry>
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index e09963c..270c018 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -57,16 +57,16 @@ class PackageKitBaseBackend:
         @param percent: Progress percentage
         '''
         if percent != None:
-            print >> sys.stderr, "percentage\t%i" % (percent)
+            print "percentage\t%i" % (percent)
         else:
-            print >> sys.stderr, "no-percentage-updates"
+            print "no-percentage-updates"
 
     def sub_percentage(self,percent=None):
         '''
         send 'subpercentage' signal : subprogress percentage
         @param percent: subprogress percentage
         '''
-        print >> sys.stderr, "subpercentage\t%i" % (percent)
+        print "subpercentage\t%i" % (percent)
 
     def error(self,err,description,exit=True):
         '''
@@ -75,7 +75,7 @@ class PackageKitBaseBackend:
         @param description: Error description
         @param exit: exit application with rc=1, if true
         '''
-        print >> sys.stderr,"error\t%s\t%s" % (err,description)
+        print "error\t%s\t%s" % (err,description)
         if exit:
             if self.isLocked():
                 self.unLock()
@@ -95,7 +95,7 @@ class PackageKitBaseBackend:
         send 'status' signal
         @param state: STATUS_DOWNLOAD, STATUS_INSTALL, STATUS_UPDATE, STATUS_REMOVE, STATUS_WAIT
         '''
-        print >> sys.stderr,"status\t%s" % (state)
+        print "status\t%s" % (state)
 
     def repo_detail(self,repoid,name,state):
         '''
@@ -110,7 +110,7 @@ class PackageKitBaseBackend:
         send 'data' signal:
         @param data:  The current worked on package
         '''
-        print >> sys.stderr,"data\t%s" % (data)
+        print "data\t%s" % (data)
 
     def metadata(self,typ,fname):
         '''
@@ -118,7 +118,7 @@ class PackageKitBaseBackend:
         @param type:   The type of metadata (repository,package,filelist,changelog,group,unknown)
         @param fname:  The filename being downloaded
         '''
-        print >> sys.stderr,"metadata\t%s\t%s" % (typ,fname)
+        print "metadata\t%s\t%s" % (typ,fname)
 
     def description(self,id,license,group,desc,url,bytes):
         '''
@@ -159,7 +159,7 @@ class PackageKitBaseBackend:
         @param restart_type: RESTART_SYSTEM, RESTART_APPLICATION,RESTART_SESSION
         @param details: Optional details about the restart
         '''
-        print >> sys.stderr,"requirerestart\t%s\t%s" % (restart_type,details)
+        print "requirerestart\t%s\t%s" % (restart_type,details)
 
     def allow_cancel(self,allow):
         '''
@@ -170,7 +170,7 @@ class PackageKitBaseBackend:
             data = 'true'
         else:
             data = 'false'
-        print >> sys.stderr,"allow-cancel\t%s" % (data)
+        print "allow-cancel\t%s" % (data)
 
     def repo_signature_required(self,repo_name,key_url,key_userid,key_id,key_fingerprint,key_timestamp,type):
         '''
@@ -183,7 +183,7 @@ class PackageKitBaseBackend:
         @param key_timestamp:   Key timestamp
         @param type:            Key type (GPG)
         '''
-        print >> sys.stderr,"repo-signature-required\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (
+        print "repo-signature-required\t%s\t%s\t%s\t%s\t%s\t%s\t%s" % (
             repo_name,key_url,key_userid,key_id,key_fingerprint,key_timestamp,type
             )
 
diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index e7d548b..7307ffe 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -66,7 +66,6 @@ struct PkBackendSpawnPrivate
 	gchar			*name;
 	gulong			 signal_finished;
 	gulong			 signal_stdout;
-	gulong			 signal_stderr;
 };
 
 G_DEFINE_TYPE (PkBackendSpawn, pk_backend_spawn, G_TYPE_OBJECT)
@@ -376,7 +375,6 @@ pk_backend_spawn_helper_delete (PkBackendSpawn *backend_spawn)
 	pk_debug ("deleting spawn %p", backend_spawn->priv->spawn);
 	g_signal_handler_disconnect (backend_spawn->priv->spawn, backend_spawn->priv->signal_finished);
 	g_signal_handler_disconnect (backend_spawn->priv->spawn, backend_spawn->priv->signal_stdout);
-	g_signal_handler_disconnect (backend_spawn->priv->spawn, backend_spawn->priv->signal_stderr);
 	g_object_unref (backend_spawn->priv->spawn);
 	backend_spawn->priv->spawn = NULL;
 	return TRUE;
@@ -426,22 +424,11 @@ pk_backend_spawn_stdout_cb (PkBackendSpawn *spawn, const gchar *line, PkBackendS
 	pk_debug ("stdout from %p = '%s'", spawn, line);
 	ret = pk_backend_spawn_parse_common_output (backend_spawn, line);
 	if (!ret) {
-		pk_warning ("failed to parse '%s'", line);
+		pk_debug ("failed to parse '%s'", line);
 	}
-}
-
-/**
- * pk_backend_spawn_stderr_cb:
- **/
-static void
-pk_backend_spawn_stderr_cb (PkBackendSpawn *spawn, const gchar *line, PkBackendSpawn *backend_spawn)
-{
-	gboolean ret;
-	g_return_if_fail (backend_spawn != NULL);
-	pk_debug ("stderr from %p = '%s'", spawn, line);
 	ret = pk_backend_spawn_parse_common_error (backend_spawn, line);
 	if (!ret) {
-		pk_warning ("failed to parse '%s'", line);
+		pk_debug ("failed to parse '%s'", line);
 	}
 }
 
@@ -465,9 +452,6 @@ pk_backend_spawn_helper_new (PkBackendSpawn *backend_spawn)
 	backend_spawn->priv->signal_stdout =
 		g_signal_connect (backend_spawn->priv->spawn, "stdout",
 				  G_CALLBACK (pk_backend_spawn_stdout_cb), backend_spawn);
-	backend_spawn->priv->signal_stderr =
-		g_signal_connect (backend_spawn->priv->spawn, "stderr",
-				  G_CALLBACK (pk_backend_spawn_stderr_cb), backend_spawn);
 	return TRUE;
 }
 
diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index 717dd71..b61ceea 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -53,25 +53,22 @@ static void     pk_spawn_init		(PkSpawn      *spawn);
 static void     pk_spawn_finalize	(GObject       *object);
 
 #define PK_SPAWN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_SPAWN, PkSpawnPrivate))
-#define PK_SPAWN_POLL_DELAY	100 /* ms */
+#define PK_SPAWN_POLL_DELAY	10 /* ms */
 #define PK_SPAWN_SIGKILL_DELAY	500 /* ms */
 
 struct PkSpawnPrivate
 {
 	gint			 child_pid;
-	gint			 stderr_fd;
 	gint			 stdout_fd;
 	guint			 poll_id;
 	guint			 kill_id;
 	gboolean		 finished;
 	PkExitEnum		 exit;
-	GString			*stderr_buf;
 	GString			*stdout_buf;
 };
 
 enum {
 	PK_SPAWN_FINISHED,
-	PK_SPAWN_STDERR,
 	PK_SPAWN_STDOUT,
 	PK_SPAWN_LAST_SIGNAL
 };
@@ -133,9 +130,6 @@ pk_spawn_emit_whole_lines (PkSpawn *spawn, GString *string, gboolean is_stdout)
 		} else if (is_stdout == TRUE) {
 			pk_debug ("emitting stdout %s", message);
 			g_signal_emit (spawn, signals [PK_SPAWN_STDOUT], 0, message);
-		} else {
-			pk_debug ("emitting stderr %s", message);
-			g_signal_emit (spawn, signals [PK_SPAWN_STDERR], 0, message);
 		}
 		g_free (message);
 		/* ITS4: ignore, g_strsplit always NULL terminates */
@@ -163,9 +157,7 @@ pk_spawn_check_child (PkSpawn *spawn)
 	}
 
 	pk_spawn_read_fd_into_buffer (spawn->priv->stdout_fd, spawn->priv->stdout_buf);
-	pk_spawn_read_fd_into_buffer (spawn->priv->stderr_fd, spawn->priv->stderr_buf);
 	pk_spawn_emit_whole_lines (spawn, spawn->priv->stdout_buf, TRUE);
-	pk_spawn_emit_whole_lines (spawn, spawn->priv->stderr_buf, FALSE);
 
 	/* check if the child exited */
 	if (waitpid (spawn->priv->child_pid, &status, WNOHANG) != spawn->priv->child_pid)
@@ -175,7 +167,6 @@ pk_spawn_check_child (PkSpawn *spawn)
 	g_source_remove (spawn->priv->poll_id);
 
 	/* child exited, display some information... */
-	close (spawn->priv->stderr_fd);
 	close (spawn->priv->stdout_fd);
 
 	if (WEXITSTATUS (status) > 0) {
@@ -302,7 +293,7 @@ pk_spawn_command (PkSpawn *spawn, const gchar *command)
 				 NULL, NULL, &spawn->priv->child_pid,
 				 NULL, /* stdin */
 				 &spawn->priv->stdout_fd,
-				 &spawn->priv->stderr_fd,
+				 NULL,
 				 NULL);
 	g_strfreev (argv);
 
@@ -314,7 +305,6 @@ pk_spawn_command (PkSpawn *spawn, const gchar *command)
 
 	/* install an idle handler to check if the child returnd successfully. */
 	fcntl (spawn->priv->stdout_fd, F_SETFL, O_NONBLOCK);
-	fcntl (spawn->priv->stderr_fd, F_SETFL, O_NONBLOCK);
 
 	/* poll quickly */
 	spawn->priv->poll_id = g_timeout_add (PK_SPAWN_POLL_DELAY, (GSourceFunc) pk_spawn_check_child, spawn);
@@ -343,11 +333,6 @@ pk_spawn_class_init (PkSpawnClass *klass)
 			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
 			      0, NULL, NULL, g_cclosure_marshal_VOID__STRING,
 			      G_TYPE_NONE, 1, G_TYPE_STRING);
-	signals [PK_SPAWN_STDERR] =
-		g_signal_new ("stderr",
-			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, g_cclosure_marshal_VOID__STRING,
-			      G_TYPE_NONE, 1, G_TYPE_STRING);
 
 	g_type_class_add_private (klass, sizeof (PkSpawnPrivate));
 }
@@ -362,14 +347,12 @@ pk_spawn_init (PkSpawn *spawn)
 	spawn->priv = PK_SPAWN_GET_PRIVATE (spawn);
 
 	spawn->priv->child_pid = -1;
-	spawn->priv->stderr_fd = -1;
 	spawn->priv->stdout_fd = -1;
 	spawn->priv->poll_id = 0;
 	spawn->priv->kill_id = 0;
 	spawn->priv->finished = FALSE;
 	spawn->priv->exit = PK_EXIT_ENUM_UNKNOWN;
 
-	spawn->priv->stderr_buf = g_string_new ("");
 	spawn->priv->stdout_buf = g_string_new ("");
 }
 
@@ -400,7 +383,6 @@ pk_spawn_finalize (GObject *object)
 	}
 
 	/* free the buffers */
-	g_string_free (spawn->priv->stderr_buf, TRUE);
 	g_string_free (spawn->priv->stdout_buf, TRUE);
 
 	G_OBJECT_CLASS (pk_spawn_parent_class)->finalize (object);
@@ -428,7 +410,6 @@ pk_spawn_new (void)
 
 PkExitEnum mexit = BAD_EXIT;
 guint stdout_count = 0;
-guint stderr_count = 0;
 guint finished_count = 0;
 
 /**
@@ -480,16 +461,6 @@ pk_test_stdout_cb (PkSpawn *spawn, const gchar *line, LibSelfTest *test)
 	stdout_count++;
 }
 
-/**
- * pk_test_stderr_cb:
- **/
-static void
-pk_test_stderr_cb (PkSpawn *spawn, const gchar *line, LibSelfTest *test)
-{
-	pk_debug ("stderr '%s'", line);
-	stderr_count++;
-}
-
 static gboolean
 cancel_cb (gpointer data)
 {
@@ -509,8 +480,6 @@ new_spawn_object (LibSelfTest *test, PkSpawn **pspawn)
 			  G_CALLBACK (pk_test_finished_cb), test);
 	g_signal_connect (*pspawn, "stdout",
 			  G_CALLBACK (pk_test_stdout_cb), test);
-	g_signal_connect (*pspawn, "stderr",
-			  G_CALLBACK (pk_test_stderr_cb), test);
 }
 
 void
@@ -578,20 +547,12 @@ libst_spawn (LibSelfTest *test)
 
 	/************************************************************/
 	libst_title (test, "make sure we got the right stdout data");
-	if (stdout_count == 4) {
+	if (stdout_count == 4+11) {
 		libst_success (test, "correct stdout count");
 	} else {
 		libst_failed (test, "wrong stdout count %i", stdout_count);
 	}
 
-	/************************************************************/
-	libst_title (test, "make sure we got the right stderr data");
-	if (stderr_count == 11) {
-		libst_success (test, "correct stderr count");
-	} else {
-		libst_failed (test, "wrong stderr count %i", stderr_count);
-	}
-
 	/* get new object */
 	new_spawn_object (test, &spawn);
 
commit 0f7652b01c550fc339da73596cfedb21ffda2e3e
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 18:28:35 2008 +0000

    make libpackagekit force WAIT when the transaction is queued

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 82786bb..209ec90 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -630,6 +630,17 @@ pk_client_progress_changed_cb (DBusGProxy  *proxy, const gchar *tid,
 }
 
 /**
+ * pk_client_change_status:
+ */
+static void
+pk_client_change_status (PkClient *client, PkStatusEnum status)
+{
+	pk_debug ("emit status-changed %s", pk_status_enum_to_text (status));
+	g_signal_emit (client , signals [PK_CLIENT_STATUS_CHANGED], 0, status);
+	client->priv->last_status = status;
+}
+
+/**
  * pk_client_status_changed_cb:
  */
 static void
@@ -646,11 +657,7 @@ pk_client_status_changed_cb (DBusGProxy *proxy, const gchar *tid, const gchar *s
 	}
 
 	status = pk_status_enum_from_text (status_text);
-
-	pk_debug ("emit status-changed %s", status_text);
-	g_signal_emit (client , signals [PK_CLIENT_STATUS_CHANGED], 0, status);
-
-	client->priv->last_status = status;
+	pk_client_change_status (client, status);
 }
 
 /**
@@ -1311,6 +1318,10 @@ pk_client_get_updates (PkClient *client, const gchar *filter, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_UPDATES;
 
@@ -1373,6 +1384,10 @@ pk_client_update_system (PkClient *client, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_UPDATE_SYSTEM;
 
@@ -1430,6 +1445,10 @@ pk_client_search_name (PkClient *client, const gchar *filter, const gchar *searc
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_SEARCH_NAME;
 	client->priv->cached_filter = g_strdup (filter);
@@ -1476,6 +1495,10 @@ pk_client_search_details (PkClient *client, const gchar *filter, const gchar *se
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_SEARCH_DETAILS;
 	client->priv->cached_filter = g_strdup (filter);
@@ -1520,6 +1543,10 @@ pk_client_search_group (PkClient *client, const gchar *filter, const gchar *sear
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_SEARCH_GROUP;
 	client->priv->cached_filter = g_strdup (filter);
@@ -1564,6 +1591,10 @@ pk_client_search_file (PkClient *client, const gchar *filter, const gchar *searc
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_SEARCH_FILE;
 	client->priv->cached_filter = g_strdup (filter);
@@ -1619,6 +1650,10 @@ pk_client_get_depends (PkClient *client, const gchar *filter, const gchar *packa
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_DEPENDS;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -1676,6 +1711,10 @@ pk_client_get_requires (PkClient *client, const gchar *filter,
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_REQUIRES;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -1729,6 +1768,10 @@ pk_client_what_provides (PkClient *client, const gchar *filter, PkProvidesEnum p
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_WHAT_PROVIDES;
 	client->priv->cached_search = g_strdup (search);
@@ -1785,6 +1828,10 @@ pk_client_get_update_detail (PkClient *client, const gchar *package_id, GError *
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_UPDATE_DETAIL;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -1827,6 +1874,10 @@ pk_client_rollback (PkClient *client, const gchar *transaction_id, GError **erro
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_ROLLBACK;
 	client->priv->cached_transaction_id = g_strdup (transaction_id);
@@ -1872,6 +1923,10 @@ pk_client_resolve (PkClient *client, const gchar *filter, const gchar *package,
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_RESOLVE;
 	client->priv->cached_filter = g_strdup (filter);
@@ -1925,6 +1980,10 @@ pk_client_get_description (PkClient *client, const gchar *package_id, GError **e
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_DESCRIPTION;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -1975,6 +2034,10 @@ pk_client_get_files (PkClient *client, const gchar *package_id, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_FILES;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -2053,6 +2116,10 @@ pk_client_remove_package (PkClient *client, const gchar *package_id, gboolean al
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_REMOVE_PACKAGE;
 	client->priv->cached_allow_deps = allow_deps;
@@ -2131,6 +2198,10 @@ pk_client_refresh_cache (PkClient *client, gboolean force, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_REFRESH_CACHE;
 	client->priv->cached_force = force;
@@ -2213,6 +2284,10 @@ pk_client_install_package (PkClient *client, const gchar *package_id, GError **e
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_INSTALL_PACKAGE;
 	client->priv->cached_package_id = g_strdup (package_id);
@@ -2298,6 +2373,10 @@ pk_client_update_packages_strv (PkClient *client, gchar **package_ids, GError **
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_UPDATE_PACKAGES;
 	client->priv->cached_package_ids = g_strdupv (package_ids);
@@ -2422,6 +2501,10 @@ pk_client_install_file (PkClient *client, const gchar *file, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_INSTALL_FILE;
 	client->priv->cached_full_path = g_strdup (file);
@@ -2498,6 +2581,10 @@ pk_client_service_pack (PkClient *client, const gchar *location, gboolean enable
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_SERVICE_PACK;
 	client->priv->cached_force = enabled;
@@ -2552,6 +2639,10 @@ pk_client_get_repo_list (PkClient *client, GError **error)
 	if (!ret) {
 		return FALSE;
 	}
+
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_GET_REPO_LIST;
 
@@ -2608,6 +2699,10 @@ pk_client_repo_enable (PkClient *client, const gchar *repo_id, gboolean enabled,
 		return FALSE;
 	}
 
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_REPO_ENABLE;
 
@@ -2691,6 +2786,10 @@ pk_client_repo_set_data (PkClient *client, const gchar *repo_id, const gchar *pa
 		return FALSE;
 	}
 
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
+
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_REPO_SET_DATA;
 
@@ -2935,6 +3034,10 @@ pk_client_get_old_transactions (PkClient *client, guint number, GError **error)
 		return FALSE;
 	}
 
+	/* allow clients to respond in the status changed callback */
+	pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
+
+
 	ret = dbus_g_proxy_call (client->priv->proxy, "GetOldTransactions", error,
 				 G_TYPE_STRING, client->priv->tid,
 				 G_TYPE_UINT, number,
commit 0d59dfd4b1a3256815fc7d25fd709f854394020b
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 18:27:42 2008 +0000

    add better logic for the RUNNING state

diff --git a/src/pk-backend.c b/src/pk-backend.c
index f1d17bd..bfb7eeb 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -480,19 +480,18 @@ pk_backend_set_status (PkBackend *backend, PkStatusEnum status)
 
 	/* backends don't do this */
 	if (status == PK_STATUS_ENUM_WAIT) {
-		pk_warning ("backend tried to wait, only the runner should set this value");
+		pk_warning ("backend tried to WAIT, only the runner should set this value");
 		pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON,
 				    "backends shouldn't use STATUS_WAIT");
-
 		return FALSE;
 	}
 
-	/* do we have to enumate a running call? */
-	if (status != PK_STATUS_ENUM_SETUP &&
-	    status != PK_STATUS_ENUM_RUNNING &&
-	    backend->priv->status == PK_STATUS_ENUM_WAIT) {
-		pk_debug ("emiting status-changed running");
-		g_signal_emit (backend, signals [PK_BACKEND_STATUS_CHANGED], 0, PK_STATUS_ENUM_RUNNING);
+	/* sanity check */
+	if (status == PK_STATUS_ENUM_SETUP && backend->priv->status != PK_STATUS_ENUM_WAIT) {
+		pk_warning ("backend tried to SETUP, but should be in WAIT");
+		pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON,
+				    "Tried to SETUP when not in WAIT");
+		return FALSE;
 	}
 
 	/* already this? */
@@ -500,6 +499,15 @@ pk_backend_set_status (PkBackend *backend, PkStatusEnum status)
 		pk_debug ("already set same status");
 		return TRUE;
 	}
+
+	/* do we have to enumate a running call? */
+	if (status != PK_STATUS_ENUM_RUNNING && status != PK_STATUS_ENUM_SETUP) {
+		if (backend->priv->status == PK_STATUS_ENUM_SETUP) {
+			pk_warning ("emiting status-changed running");
+			g_signal_emit (backend, signals [PK_BACKEND_STATUS_CHANGED], 0, PK_STATUS_ENUM_RUNNING);
+		}
+	}
+
 	backend->priv->status = status;
 
 	pk_debug ("emiting status-changed %s", pk_status_enum_to_text (status));
commit 1a21b62d9f4ba31d1fb6acfd04d8759437642688
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 18:07:58 2008 +0000

    emulate the RUNNING state for clients

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 8e66870..f1d17bd 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -480,12 +480,21 @@ pk_backend_set_status (PkBackend *backend, PkStatusEnum status)
 
 	/* backends don't do this */
 	if (status == PK_STATUS_ENUM_WAIT) {
+		pk_warning ("backend tried to wait, only the runner should set this value");
 		pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON,
 				    "backends shouldn't use STATUS_WAIT");
 
 		return FALSE;
 	}
 
+	/* do we have to enumate a running call? */
+	if (status != PK_STATUS_ENUM_SETUP &&
+	    status != PK_STATUS_ENUM_RUNNING &&
+	    backend->priv->status == PK_STATUS_ENUM_WAIT) {
+		pk_debug ("emiting status-changed running");
+		g_signal_emit (backend, signals [PK_BACKEND_STATUS_CHANGED], 0, PK_STATUS_ENUM_RUNNING);
+	}
+
 	/* already this? */
 	if (backend->priv->status == status) {
 		pk_debug ("already set same status");
commit 5214aea79c6309b55b5f66062a8338d5da84d864
Author: root <root at solitude.devel.redhat.com>
Date:   Tue Mar 25 13:45:53 2008 -0400

    Fix InstallFile method to treat srpms differently.

diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 7a5b1cb..1d8c3ab 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -837,26 +837,44 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         '''
         self._check_init()
         self._lock_yum()
-        self.AllowCancel(False)
+        self.AllowCancel(True)
         self.PercentageChanged(0)
+        self.StatusChanged(STATUS_QUERY)
 
         pkgs_to_inst = []
         self.yumbase.conf.gpgcheck=0
-        self._localInstall(inst_file)
+        po = self._localInstall(inst_file)
+
+        self.AllowCancel(False)
+        self.StatusChanged(STATUS_INSTALL)
+
         try:
-            # Added the package to the transaction set
-            if len(self.yumbase.tsInfo) > 0:
-                successful = self._runYumTransaction()
-                if not successful:
-                    return
-	    else:
-		self.StatusChanged(STATUS_CLEANUP)
+            if po.arch == 'src':
+                # Special case for source package - don't resolve deps
+                rpmDisplay = PackageKitCallback(self)
+                callback = ProcessTransPackageKitCallback(self)
+                self.yumbase._doTransaction(callback,
+                                            display=rpmDisplay)
+            else:
+                # Added the package to the transaction set
+                if len(self.yumbase.tsInfo) > 0:
+                    successful = self._runYumTransaction()
+                    if not successful:
+                        return
+                    else:
+                        self.StatusChanged(STATUS_CLEANUP)
         except yum.Errors.InstallError,e:
             msgs = '\n'.join(e)
             self._unlock_yum()
             self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
             self.Finished(EXIT_FAILED)
             return
+        except yum.Errors.YumBaseError, ye:
+            retmsg = "Could not install package:\n" + ye.value
+            self._unlock_yum()
+            self.ErrorCode(ERROR_TRANSACTION_ERROR,retmsg)
+            self.Finished(EXIT_FAILED)
+            return
 
         self._unlock_yum()
         self.Finished(EXIT_SUCCESS)
@@ -1640,6 +1658,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.Finished(EXIT_FAILED)
             self.Exit()
 
+        if po.arch == "src":
+            # Short circuit for srpms
+            self.yumbase.localPackages.append(po)
+            self.yumbase.install(po=po)
+
+            return po
+
         # everything installed that matches the name
         installedByKey = self.yumbase.rpmdb.searchNevra(name=po.name)
         # go through each package
@@ -1690,6 +1715,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.yumbase.localPackages.append(po)
             self.yumbase.tsInfo.addUpdate(po, oldpo)
 
+        return po
+
     def _check_for_reboot(self):
         md = self.updateMetadata
         for txmbr in self.yumbase.tsInfo:
@@ -1709,6 +1736,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         This will only work with yum 3.2.4 or higher
         Returns True on success, False on failure
         '''
+
         rc,msgs =  self.yumbase.buildTransaction()
         if rc !=2:
             retmsg = "Error in Dependency Resolution\n" +"\n".join(msgs)
@@ -1716,57 +1744,59 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,retmsg)
             self.Finished(EXIT_FAILED)
             return False
-        else:
-            self._check_for_reboot()
-            if removedeps == False:
-                if len(self.yumbase.tsInfo) > 1:
-                    retmsg = 'package could not be remove, because something depends on it'
-                    self._unlock_yum()
-                    self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,retmsg)
-                    self.Finished(EXIT_FAILED)
-                    return False
-            try:
-                rpmDisplay = PackageKitCallback(self)
-                callback = ProcessTransPackageKitCallback(self)
-                self.yumbase.processTransaction(callback=callback,
-                                                rpmDisplay=rpmDisplay)
-            except yum.Errors.YumDownloadError, ye:
-                retmsg = "Error in Download\n" + "\n".join(ye.value)
-                self._unlock_yum()
-                self.ErrorCode(ERROR_PACKAGE_DOWNLOAD_FAILED,retmsg)
-                self.Finished(EXIT_FAILED)
-                return False
-            except yum.Errors.YumGPGCheckError, ye:
-                retmsg = "Error in Package Signatures\n" +"\n".join(ye.value)
+
+        self._check_for_reboot()
+
+        if removedeps == False and len(self.yumbase.tsInfo) > 1:
+            retmsg = 'package could not be removed, because something depends on it'
+            self._unlock_yum()
+            self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,retmsg)
+            self.Finished(EXIT_FAILED)
+            return False
+
+        try:
+            rpmDisplay = PackageKitCallback(self)
+            callback = ProcessTransPackageKitCallback(self)
+            self.yumbase.processTransaction(callback=callback,
+                                            rpmDisplay=rpmDisplay)
+        except yum.Errors.YumDownloadError, ye:
+            retmsg = "Error in Download\n" + "\n".join(ye.value)
+            self._unlock_yum()
+            self.ErrorCode(ERROR_PACKAGE_DOWNLOAD_FAILED,retmsg)
+            self.Finished(EXIT_FAILED)
+            return False
+        except yum.Errors.YumGPGCheckError, ye:
+            retmsg = "Error in Package Signatures\n" +"\n".join(ye.value)
+            self._unlock_yum()
+            self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,retmsg)
+            self.Finished(EXIT_FAILED)
+            return False
+        except GPGKeyNotImported, e:
+            keyData = self.yumbase.missingGPGKey
+            if not keyData:
                 self._unlock_yum()
-                self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,retmsg)
-                self.Finished(EXIT_FAILED)
-                return False
-            except GPGKeyNotImported, e:
-                keyData = self.yumbase.missingGPGKey
-                if not keyData:
-                    self._unlock_yum()
-                    self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,
+                self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,
                                "GPG key not imported, but no GPG information received from Yum.")
-                    self.Finished(EXIT_FAILED)
-                    return False
-                self.RepoSignatureRequired(keyData['po'].repoid,
-                                           keyData['keyurl'],
-                                           keyData['userid'],
-                                           keyData['hexkeyid'],
-                                           keyData['fingerprint'],
-                                           keyData['timestamp'],
-                                           SIGTYE_GPG)
-                self._unlock_yum()
-                self.ErrorCode(ERROR_GPG_FAILURE,"GPG key not imported.")
-                self.Finished(EXIT_FAILED)
-                return False
-            except yum.Errors.YumBaseError, ye:
-                retmsg = "Error in Transaction Processing\n" + ye.value
-                self._unlock_yum()
-                self.ErrorCode(ERROR_TRANSACTION_ERROR,retmsg)
                 self.Finished(EXIT_FAILED)
                 return False
+            self.RepoSignatureRequired(keyData['po'].repoid,
+                                       keyData['keyurl'],
+                                       keyData['userid'],
+                                       keyData['hexkeyid'],
+                                       keyData['fingerprint'],
+                                       keyData['timestamp'],
+                                       SIGTYE_GPG)
+            self._unlock_yum()
+            self.ErrorCode(ERROR_GPG_FAILURE,"GPG key not imported.")
+            self.Finished(EXIT_FAILED)
+            return False
+        except yum.Errors.YumBaseError, ye:
+            retmsg = "Error in Transaction Processing\n" + ye.value
+            self._unlock_yum()
+            self.ErrorCode(ERROR_TRANSACTION_ERROR,retmsg)
+            self.Finished(EXIT_FAILED)
+            return False
+
         return True
 
     def _get_status(self,notice):
commit 3f14fef33480a6e465b1da92d987e36f80a82725
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 17:28:27 2008 +0000

    make sure backends don't emit PK_STATUS_ENUM_WAIT

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 7694b95..8e66870 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -478,6 +478,14 @@ pk_backend_set_status (PkBackend *backend, PkStatusEnum status)
 		return FALSE;
 	}
 
+	/* backends don't do this */
+	if (status == PK_STATUS_ENUM_WAIT) {
+		pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON,
+				    "backends shouldn't use STATUS_WAIT");
+
+		return FALSE;
+	}
+
 	/* already this? */
 	if (backend->priv->status == status) {
 		pk_debug ("already set same status");
commit 555ddc3154edac3d6e2aaaae7c1b1cd6c783f0a2
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 17:26:56 2008 +0000

    add another status enum so we can do the 'waiting' UI elements better

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index a98005d..ed09c5c 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -51,6 +51,7 @@ static PkEnumMatch enum_status[] = {
 	{PK_STATUS_ENUM_UNKNOWN,		"unknown"},	/* fall though value */
 	{PK_STATUS_ENUM_WAIT,			"wait"},
 	{PK_STATUS_ENUM_SETUP,			"setup"},
+	{PK_STATUS_ENUM_RUNNING,		"running"},
 	{PK_STATUS_ENUM_QUERY,			"query"},
 	{PK_STATUS_ENUM_INFO,			"info"},
 	{PK_STATUS_ENUM_REFRESH_CACHE,		"refresh-cache"},
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 11f61d8..d449c2a 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -81,10 +81,22 @@ typedef enum {
  * Icons that change to represent the current status of the transaction will
  * use these constants
  * If you add to these, make sure you add filenames in pk-watch also
+ *
+ * A typical transaction will do:
+ * - schedule task
+ *	WAIT
+ * - run task
+ *	SETUP
+ * - wait for lock
+ *	RUNNING
+ *
+ * This means that backends should run pk_backend_set_status (backend, PK_STATUS_ENUM_RUNNING)
+ * when they are ready to start running the transaction and after a lock has been got.
  **/
 typedef enum {
-	PK_STATUS_ENUM_SETUP,
 	PK_STATUS_ENUM_WAIT,
+	PK_STATUS_ENUM_SETUP,
+	PK_STATUS_ENUM_RUNNING,
 	PK_STATUS_ENUM_QUERY,
 	PK_STATUS_ENUM_INFO,
 	PK_STATUS_ENUM_REMOVE,
commit 6031a6917ed966bd8c4092c6c9565762088d04ea
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 17:22:30 2008 +0000

    add stubs to get and set internal state. more to come

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 215b8e8..7694b95 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -123,6 +123,33 @@ enum {
 static guint signals [PK_BACKEND_LAST_SIGNAL] = { 0 };
 
 /**
+ * pk_backend_set_internal:
+ *
+ * Designed for volatile internal state, such as the authentication prompt
+ * response, the proxy to use and that sort of thing
+ **/
+gboolean
+pk_backend_set_internal (PkBackend *backend, const gchar *key, const gchar *data)
+{
+	g_return_val_if_fail (backend != NULL, FALSE);
+	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
+	return FALSE;
+}
+
+/**
+ * pk_backend_get_internal:
+ *
+ * Must g_free() the return value. Returns NULL on error.
+ **/
+gchar *
+pk_backend_get_internal (PkBackend *backend, const gchar *key)
+{
+	g_return_val_if_fail (backend != NULL, NULL);
+	g_return_val_if_fail (PK_IS_BACKEND (backend), NULL);
+	return NULL;
+}
+
+/**
  * pk_backend_build_library_path:
  **/
 static gchar *
diff --git a/src/pk-backend.h b/src/pk-backend.h
index a1c1fdd..506e974 100644
--- a/src/pk-backend.h
+++ b/src/pk-backend.h
@@ -110,6 +110,14 @@ gboolean         pk_backend_repo_signature_required     (PkBackend      *backend
 							 const gchar    *key_timestamp,
 							 PkSigTypeEnum   type);
 
+/* internal state */
+gboolean	 pk_backend_set_internal		(PkBackend	*backend,
+							 const gchar	*key,
+							 const gchar	*data);
+gchar		*pk_backend_get_internal		(PkBackend	*backend,
+							 const gchar	*key);
+
+
 /* helper functions */
 gboolean	 pk_backend_not_implemented_yet		(PkBackend	*backend,
 							 const gchar	*method);
commit afdd0dadc87749580212b183e8dc10e9d45af48c
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Mar 25 10:52:24 2008 -0400

    Add another license tag.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 5e12b41..a98005d 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -313,6 +313,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_LPL,                  "LPL"},
 	{PK_LICENSE_ENUM_MECAB_IPADIC,         "mecab-ipadic"},
 	{PK_LICENSE_ENUM_MIT,                  "MIT"},
+	{PK_LICENSE_ENUM_MIT_WITH_ADVERTISING, "MIT with advertising"},
 	{PK_LICENSE_ENUM_MPLV1_DOT_0,          "MPLv1.0"},
 	{PK_LICENSE_ENUM_MPLV1_DOT_1,          "MPLv1.1"},
 	{PK_LICENSE_ENUM_NCSA,                 "NCSA"},
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index ad62bf0..11f61d8 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -371,6 +371,7 @@ typedef enum {
 	PK_LICENSE_ENUM_LPL,
 	PK_LICENSE_ENUM_MECAB_IPADIC,
 	PK_LICENSE_ENUM_MIT,
+	PK_LICENSE_ENUM_MIT_WITH_ADVERTISING,
 	PK_LICENSE_ENUM_MPLV1_DOT_0,
 	PK_LICENSE_ENUM_MPLV1_DOT_1,
 	PK_LICENSE_ENUM_NCSA,
commit 6ae22b8d0bf5861eddee4b8132407b0567f6953b
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Mar 25 10:34:04 2008 -0400

    Add removed enums back.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 1694502..5e12b41 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -120,6 +120,8 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_REPO_NOT_FOUND,		"repo-not-found"},
 	{PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,	"cannot-remove-system-package"},
 	{PK_ERROR_ENUM_PROCESS_KILL,		"process-kill"},
+        {PK_ERROR_ENUM_FAILED_INITIALIZATION,   "failed-initialization"},
+        {PK_ERROR_ENUM_FAILED_FINALISE,         "failed-finalise"},
 	{PK_ERROR_ENUM_FAILED_CONFIG_PARSING,	"failed-config-parsing"},
 	{PK_ERROR_ENUM_CANNOT_CANCEL,		"cannot-cancel"},
 	{PK_ERROR_ENUM_CANNOT_GET_LOCK,         "cannot-get-lock"},
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 87e8a25..ad62bf0 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -191,6 +191,8 @@ typedef enum {
 	PK_ERROR_ENUM_REPO_NOT_FOUND,
 	PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,
 	PK_ERROR_ENUM_PROCESS_KILL,
+        PK_ERROR_ENUM_FAILED_INITIALIZATION,
+        PK_ERROR_ENUM_FAILED_FINALISE,
 	PK_ERROR_ENUM_FAILED_CONFIG_PARSING,
 	PK_ERROR_ENUM_CANNOT_CANCEL,
 	PK_ERROR_ENUM_CANNOT_GET_LOCK,
commit 8418a3d611850d5c3db85228f0d543c10714a0a9
Merge: 339cd62... e4ddf39...
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 12:28:29 2008 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 339cd6237694b2c1f4c01a392446ca0ccbe61a0d
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 12:21:13 2008 +0000

    add some trivial percentage percentage calls to the dummy backend

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index 39ee8a4..1a1df6f 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -479,6 +479,7 @@ backend_update_packages_update_timeout (gpointer data)
 	_package_current++;
 	len = pk_package_ids_size (_package_ids);
 	if (_package_current + 1 > len) {
+		pk_backend_set_percentage (backend, 100);
 		pk_backend_finished (backend);
 		_signal_timeout = 0;
 		return FALSE;
@@ -504,6 +505,7 @@ backend_update_packages_download_timeout (gpointer data)
 	if (_package_current + 1 > len) {
 		_package_current = 0;
 		pk_backend_set_status (backend, PK_STATUS_ENUM_UPDATE);
+		pk_backend_set_percentage (backend, 50);
 		_signal_timeout = g_timeout_add (2000, backend_update_packages_update_timeout, backend);
 		return FALSE;
 	}
@@ -519,6 +521,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 	g_return_if_fail (backend != NULL);
 	_package_ids = package_ids;
 	_package_current = 0;
+	pk_backend_set_percentage (backend, 0);
 	pk_backend_set_status (backend, PK_STATUS_ENUM_DOWNLOAD);
 	_signal_timeout = g_timeout_add (2000, backend_update_packages_download_timeout, backend);
 }
commit ff55f744fbec892ed72521495fd1836c49246d1a
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 12:19:46 2008 +0000

    fix a double free in libpackagekit in the new code

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 637281d..82786bb 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -522,6 +522,7 @@ pk_client_reset (PkClient *client, GError **error)
 	client->priv->cached_filter = NULL;
 	client->priv->cached_search = NULL;
 	client->priv->cached_search = NULL;
+	client->priv->cached_package_ids = NULL;
 	client->priv->use_buffer = FALSE;
 	client->priv->synchronous = FALSE;
 	client->priv->name_filter = FALSE;
commit e4ddf39e4a456b618416e7fb22545a399bde30ca
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Tue Mar 25 12:46:04 2008 +0100

    poldek: make GetRequires use recursive, but only for installed packages

diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index d9965f4..13daa74 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -570,7 +570,10 @@ poldek_get_installed_packages (void)
 static void
 do_requires (tn_array *installed, tn_array *available, tn_array *requires, struct pkg *pkg, DepsData *data)
 {
-	gint	i;
+	tn_array	*tmp = NULL;
+	gint		i;
+
+	tmp = n_array_new (2, NULL, NULL);
 
 	if (data->filter->installed) {
 		for (i = 0; i < n_array_size (installed); i++) {
@@ -585,6 +588,10 @@ do_requires (tn_array *installed, tn_array *available, tn_array *requires, struc
         	        if (!ipkg->reqs)
 				continue;
 
+			/* package already added to the array */
+			if (poldek_pkg_in_array (ipkg, requires, (tn_fn_cmp)pkg_cmp_name_evr_rev))
+				continue;
+
 			for (j = 0; j < n_array_size (ipkg->reqs); j++) {
 				struct capreq   *req = n_array_nth (ipkg->reqs, j);
 
@@ -595,6 +602,7 @@ do_requires (tn_array *installed, tn_array *available, tn_array *requires, struc
 
 				if (pkg_satisfies_req (pkg, req, 1)) {
 					n_array_push (requires, pkg_link (ipkg));
+					n_array_push (tmp, pkg_link (ipkg));
                                 	break;
 				}
                 	}
@@ -612,6 +620,10 @@ do_requires (tn_array *installed, tn_array *available, tn_array *requires, struc
 	                if (!apkg->reqs)
 	                        continue;
 
+			/* package already added to the array */
+			if (poldek_pkg_in_array (apkg, requires, (tn_fn_cmp)pkg_cmp_name_evr_rev))
+				continue;
+
 	                for (j = 0; j < n_array_size (apkg->reqs); j++) {
 	                        struct capreq   *req = n_array_nth (apkg->reqs, j);
 
@@ -621,14 +633,26 @@ do_requires (tn_array *installed, tn_array *available, tn_array *requires, struc
 	                                continue;
 
 	                        if (pkg_satisfies_req (pkg, req, 1)) {
-	                                if (!poldek_pkg_in_array (apkg, requires, (tn_fn_cmp)pkg_cmp_name_evr_rev))
-	                                        n_array_push (requires, pkg_link (apkg));
-
+	                                n_array_push (requires, pkg_link (apkg));
+	                                n_array_push (tmp, pkg_link (apkg));
 	                                break;
                         	}
                 	}
         	}
         }
+
+	/* FIXME: recursive takes too much time for available packages, so don't use it */
+	if (!data->filter->not_installed) {
+		if (data->recursive && tmp && n_array_size (tmp) > 0) {
+			for (i = 0; i < n_array_size (tmp); i++) {
+				struct pkg	*p = n_array_nth (tmp, i);
+
+				do_requires (installed, available, requires, p, data);
+			}
+		}
+	}
+
+	n_array_free (tmp);
 }
 
 /**
@@ -1301,7 +1325,6 @@ backend_get_files (PkBackend *backend, const gchar *package_id)
 }
 
 /**
- * FIXME: recursive currently omited
  * backend_get_requires:
  */
 static gboolean
commit 85783683bb89c9a803ec34d87edfefb5146e4a2c
Author: user1 <user1 at scthmbxdtp.sct.com>
Date:   Tue Mar 25 00:35:51 2008 -0600

    remove incorrect pk_backend_package call causing warning popups

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index cb72cda..ace7daa 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -851,13 +851,12 @@ backend_install_package_thread (PkBackendThread *thread, gpointer data)
 	pk_backend_set_percentage (backend, 0);
 
 	PkPackageId *pi = pk_package_id_new_from_string (package_id);
-        if (pi == NULL) {
-                pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
-                g_free (package_id);
-
+	if (pi == NULL) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
+		g_free (package_id);
 		pk_backend_finished (backend);
-                return FALSE;
-        }
+		return FALSE;
+	}
 
 	zypp::ZYpp::Ptr zypp;
 	zypp = get_zypp ();
@@ -933,6 +932,7 @@ backend_install_package_thread (PkBackendThread *thread, gpointer data)
 static void
 backend_install_package (PkBackend *backend, const gchar *package_id)
 {
+	//pk_debug ("package_id=%s", package_id);
 	g_return_if_fail (backend != NULL);
 
 	// For now, don't let the user cancel the install once it's started
@@ -1772,6 +1772,6 @@ extern "C" PK_BACKEND_OPTIONS (
 	backend_get_repo_list,			/* get_repo_list */
 	backend_repo_enable,			/* repo_enable */
 	backend_repo_set_data,			/* repo_set_data */
-        NULL,                                   /* service_pack */
-        backend_what_provides                   /* what_provides */
+	NULL,                                   /* service_pack */
+	backend_what_provides                   /* what_provides */
 );
diff --git a/backends/zypp/zypp-events.h b/backends/zypp/zypp-events.h
index b97613d..918fc7a 100644
--- a/backends/zypp/zypp-events.h
+++ b/backends/zypp/zypp-events.h
@@ -153,7 +153,7 @@ struct InstallResolvableReportReceiver : public zypp::callback::ReceiveReport<zy
 	{
 		clear_package_id ();
 		_package_id = zypp_build_package_id_from_resolvable (resolvable->satSolvable ());
-		//fprintf (stderr, "\n\n----> InstallResolvableReportReceiver::start(): %s\n\n", _package_id == NULL ? "unknown" : _package_id);
+		//pk_debug ("InstallResolvableReportReceiver::start(): %s", _package_id == NULL ? "unknown" : _package_id);
 		if (_package_id != NULL) {
 			pk_backend_set_status (_backend, PK_STATUS_ENUM_INSTALL);
 			pk_backend_package (_backend, PK_INFO_ENUM_INSTALLING, _package_id, "TODO: Put the package summary here if possible");
@@ -163,7 +163,7 @@ struct InstallResolvableReportReceiver : public zypp::callback::ReceiveReport<zy
 
 	virtual bool progress (int value, zypp::Resolvable::constPtr resolvable)
 	{
-		//fprintf (stderr, "\n\n----> InstallResolvableReportReceiver::progress(), %s:%d\n\n", _package_id == NULL ? "unknown" : _package_id, value);
+		//pk_debug ("InstallResolvableReportReceiver::progress(), %s:%d", _package_id == NULL ? "unknown" : _package_id, value);
 		if (_package_id != NULL)
 			update_sub_percentage (value);
 		return true;
@@ -171,15 +171,15 @@ struct InstallResolvableReportReceiver : public zypp::callback::ReceiveReport<zy
 
 	virtual Action problem (zypp::Resolvable::constPtr resolvable, Error error, const std::string &description, RpmLevel level)
 	{
-		//fprintf (stderr, "\n\n----> InstallResolvableReportReceiver::problem()\n\n");
+		//pk_debug ("InstallResolvableReportReceiver::problem()");
 		return ABORT;
 	}
 
 	virtual void finish (zypp::Resolvable::constPtr resolvable, Error error, const std::string &reason, RpmLevel level)
 	{
-		//fprintf (stderr, "\n\n----> InstallResolvableReportReceiver::finish(): %s\n\n", _package_id == NULL ? "unknown" : _package_id);
+		//pk_debug ("InstallResolvableReportReceiver::finish(): %s", _package_id == NULL ? "unknown" : _package_id);
 		if (_package_id != NULL) {
-			pk_backend_package (_backend, PK_INFO_ENUM_INSTALLED, _package_id, "TODO: Put the package summary here if possible");
+			//pk_backend_package (_backend, PK_INFO_ENUM_INSTALLED, _package_id, "TODO: Put the package summary here if possible");
 			clear_package_id ();
 		}
 	}
commit b365db5858d8ec8a61cd3aa861336bee510b184a
Merge: 11438f7... c3992a0...
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Mar 24 21:56:05 2008 -0400

    Merge branch 'master' of git+ssh://rnorwood@git.packagekit.org/srv/git/PackageKit

commit 11438f72b552c27ae62dfd553fdecb2e159e1fa2
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Mar 24 21:54:49 2008 -0400

    Banish InternalError from yum2 backend.

diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 24469b4..7a5b1cb 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -351,7 +351,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 time.sleep(2)
                 retries += 1
                 if retries > 20:
-                    self.ErrorCode(ERROR_INTERNAL_ERROR,'Yum is locked by another application')
+                    self.ErrorCode(ERROR_CANNOT_GET_LOCK,'Yum is locked by another application')
                     self.Finished(EXIT_FAILED)
                     self.loop.quit()
 
@@ -661,7 +661,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.yumbase.conf.throttle = old_throttle
             self.yumbase.conf.skip_broken = old_skip_broken
             self._unlock_yum()
-            self.ErrorCode(ERROR_INTERNAL_ERROR,"Nothing to do")
+            self.ErrorCode(ERROR_NO_PACKAGES_TO_UPDATE,"Nothing to do")
             self.Finished(EXIT_FAILED)
             return
 
@@ -726,7 +726,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         except yum.Errors.YumBaseError, e:
             self._unlock_yum()
-            self.ErrorCode(ERROR_INTERNAL_ERROR,str(e))
+            # This should be a better-defined error, but I'm not sure
+            # what the exceptions yum is likely to throw here are.
+            self.ErrorCode(ERROR_UNKNOWN,str(e))
             self.Finished(EXIT_FAILED)
             self.Exit()
 
@@ -1210,7 +1212,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 repo.cfg.write(file(repo.repofile, 'w'))
             except IOError, e:
                 self._unlock_yum()
-                self.ErrorCode(ERROR_INTERNAL_ERROR,str(e))
+                self.ErrorCode(ERROR_CANNOT_WRITE_REPO_CONFIG,str(e))
                 self.Finished(EXIT_FAILED)
                 return
         else:
@@ -1634,7 +1636,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             po = yum.packages.YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=pkg)
         except yum.Errors.MiscError:
             self._unlock_yum()
-            self.ErrorCode(ERROR_INTERNAL_ERROR,'Cannot open file: %s. Skipping.' % pkg)
+            self.ErrorCode(ERROR_LOCAL_INSTALL_FAILED,'Cannot open file: %s. Skipping.' % pkg)
             self.Finished(EXIT_FAILED)
             self.Exit()
 
@@ -1737,14 +1739,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             except yum.Errors.YumGPGCheckError, ye:
                 retmsg = "Error in Package Signatures\n" +"\n".join(ye.value)
                 self._unlock_yum()
-                self.ErrorCode(ERROR_INTERNAL_ERROR,retmsg)
+                self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,retmsg)
                 self.Finished(EXIT_FAILED)
                 return False
             except GPGKeyNotImported, e:
                 keyData = self.yumbase.missingGPGKey
                 if not keyData:
                     self._unlock_yum()
-                    self.ErrorCode(ERROR_INTERNAL_ERROR,
+                    self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,
                                "GPG key not imported, but no GPG information received from Yum.")
                     self.Finished(EXIT_FAILED)
                     return False
diff --git a/docs/spec/pk-concepts.xml b/docs/spec/pk-concepts.xml
index 07a3f74..9c54af0 100644
--- a/docs/spec/pk-concepts.xml
+++ b/docs/spec/pk-concepts.xml
@@ -202,6 +202,13 @@
             </entry>
           </row>
           <row>
+            <entry><literal>no-cache</literal></entry>
+            <entry>
+              The operation is trying to read from the cache, but the cache
+              is not present or invalid
+            </entry>
+          </row>
+          <row>
             <entry><literal>gpg-failure</literal></entry>
             <entry>There was a GPG failure in the transaction</entry>
           </row>
@@ -217,10 +224,10 @@
             </entry>
           </row>
           <row>
-            <entry><literal>no-cache</literal></entry>
+            <entry><literal>package-not-found</literal></entry>
             <entry>
-              The operation is trying to read from the cache, but the cache
-              is not present or invalid
+              The package that is trying to be removed or updated is not
+              installed
             </entry>
           </row>
           <row>
@@ -248,6 +255,12 @@
             </entry>
           </row>
           <row>
+            <entry><literal>group-not-found</literal></entry>
+            <entry>
+	      The specified software group was not found.
+            </entry>
+          </row>
+          <row>
             <entry><literal>create-thread-failed</literal></entry>
             <entry>Failed to create a thread</entry>
           </row>
@@ -259,6 +272,13 @@
             </entry>
           </row>
           <row>
+            <entry><literal>transaction-cancelled</literal></entry>
+            <entry>
+              The transaction was cancelled as the result of a call
+              to Cancel()
+            </entry>
+          </row>
+          <row>
             <entry><literal>repo-not-found</literal></entry>
             <entry>The repository name could not be found</entry>
           </row>
@@ -282,6 +302,53 @@
               quit request. This is probably due to it being cancelled
             </entry>
           </row>
+          <row>
+            <entry><literal>failed-config-parsing</literal></entry>
+            <entry>
+	      Configuration files could not be read or parsed.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>cannot-cancel</literal></entry>
+            <entry>
+	      The Cancel() method was called, but it is too late to
+	      cancel the current transaction.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>cannot-get-lock</literal></entry>
+            <entry>
+	      The backend could not acquire a lock on the underlying
+	      package management system.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>no-packages-to-update</literal></entry>
+            <entry>
+	      UpdateSystem() was called, but there are no packages to update.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>cannot-write-repo-config</literal></entry>
+            <entry>
+	      RepoEnable() or RepoSetData() was called, but the
+	      repository configuration file could not be written to.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>local-install-failed</literal></entry>
+            <entry>
+	      A local file could not be installed.  The file might not
+	      be readable, or it might not contain a valid package.
+            </entry>
+          </row>
+          <row>
+            <entry><literal>bad-gpg-signature</literal></entry>
+            <entry>
+	      The package is signed with a GPG signature, but that
+	      signature is not valid in some way.
+            </entry>
+          </row>
         </tbody>
       </tgroup>
     </informaltable>
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 6f38d55..1694502 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -120,10 +120,13 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_REPO_NOT_FOUND,		"repo-not-found"},
 	{PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,	"cannot-remove-system-package"},
 	{PK_ERROR_ENUM_PROCESS_KILL,		"process-kill"},
-	{PK_ERROR_ENUM_FAILED_INITIALIZATION,	"failed-initialization"},
-	{PK_ERROR_ENUM_FAILED_FINALISE,		"failed-finalise"},
 	{PK_ERROR_ENUM_FAILED_CONFIG_PARSING,	"failed-config-parsing"},
 	{PK_ERROR_ENUM_CANNOT_CANCEL,		"cannot-cancel"},
+	{PK_ERROR_ENUM_CANNOT_GET_LOCK,         "cannot-get-lock"},
+	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,   "no-packages-to-update"},
+	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,        "cannot-write-repo-config"},
+	{PK_ERROR_LOCAL_INSTALL_FAILED,         "local-install-failed"},
+	{PK_ERROR_BAD_GPG_SIGNATURE,            "bad-gpg-signature"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index dfaaf60..87e8a25 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -191,10 +191,13 @@ typedef enum {
 	PK_ERROR_ENUM_REPO_NOT_FOUND,
 	PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,
 	PK_ERROR_ENUM_PROCESS_KILL,
-	PK_ERROR_ENUM_FAILED_INITIALIZATION,
-	PK_ERROR_ENUM_FAILED_FINALISE,
 	PK_ERROR_ENUM_FAILED_CONFIG_PARSING,
 	PK_ERROR_ENUM_CANNOT_CANCEL,
+	PK_ERROR_ENUM_CANNOT_GET_LOCK,
+	PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,
+	PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,
+	PK_ERROR_LOCAL_INSTALL_FAILED,
+	PK_ERROR_BAD_GPG_SIGNATURE,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 
commit c3992a05fe16e0585e387c0af2674e3f4370bd52
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 00:13:58 2008 +0000

    optimise adding to the locale list to make the pk-update-desktop up to three times as fast

diff --git a/client/pk-import-desktop.c b/client/pk-import-desktop.c
index 6070158..4e05b5b 100644
--- a/client/pk-import-desktop.c
+++ b/client/pk-import-desktop.c
@@ -130,9 +130,11 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 	key_array = g_key_file_get_keys (key, G_KEY_FILE_DESKTOP_GROUP, &len, NULL);
 	locale_array = g_ptr_array_new ();
 	for (i=0; i<len; i++) {
-		/* set the locale */
-		locale_temp = pk_import_get_locale (key_array[i]);
-		g_ptr_array_add (locale_array, g_strdup (locale_temp));
+		if (g_str_has_prefix (key_array[i], "Name")) {
+			/* set the locale */
+			locale_temp = pk_import_get_locale (key_array[i]);
+			g_ptr_array_add (locale_array, g_strdup (locale_temp));
+		}
 	}
 	g_strfreev (key_array);
 
commit fb0c94b5d5760b220131f8d4596886e92e0aeacb
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 00:06:55 2008 +0000

    show localisation on the webpge

diff --git a/docs/html/img/pk-application-groups.png b/docs/html/img/pk-application-groups.png
index 6798875..c6a83af 100644
Binary files a/docs/html/img/pk-application-groups.png and b/docs/html/img/pk-application-groups.png differ
commit 9636df6a0ee32e1466e8a190ce31899d13520881
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Mar 25 00:02:34 2008 +0000

    Exec and Icon are not localised, not sure how this ever worked before

diff --git a/client/pk-import-desktop.c b/client/pk-import-desktop.c
index 7f21607..6070158 100644
--- a/client/pk-import-desktop.c
+++ b/client/pk-import-desktop.c
@@ -175,8 +175,8 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 	g_free (name_unlocalised);
 	g_print ("]\n");
 
-	exec = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP, "Exec", locale, NULL);
-	icon = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP, "Icon", locale, NULL);
+	exec = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Exec", NULL);
+	icon = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Icon", NULL);
 	pk_debug ("PackageName=%s, Exec=%s, Icon=%s", package_name, exec, icon);
 	pk_extra_set_package_detail (extra, package_name, icon, exec);
 	g_free (icon);
commit 0a51b4b54df51d2fece1e4a597ac6156000db33a
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 23:56:30 2008 +0000

    increase speed of pk-import-desktop by an order of magnitude using a per-file locale list

diff --git a/client/pk-import-desktop.c b/client/pk-import-desktop.c
index 2e2205f..7f21607 100644
--- a/client/pk-import-desktop.c
+++ b/client/pk-import-desktop.c
@@ -38,7 +38,6 @@
 
 static PkClient *client = NULL;
 static PkExtra *extra = NULL;
-static GPtrArray *locale_array = NULL;
 
 static gchar *
 pk_desktop_get_name_for_file (const gchar *filename)
@@ -87,6 +86,22 @@ pk_desktop_get_name_for_file (const gchar *filename)
 	return name;
 }
 
+static gchar *
+pk_import_get_locale (const gchar *buffer)
+{
+	guint len;
+	gchar *locale;
+	gchar *result;
+	result = g_strrstr (buffer, "[");
+	if (result == NULL) {
+		return NULL;
+	}
+	locale = g_strdup (result+1);
+	len = strlen (locale);
+	locale[len-1] = '\0';
+	return locale;
+}
+
 static void
 pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 {
@@ -100,6 +115,10 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 	gchar *comment = NULL;
 	gchar *genericname = NULL;
 	const gchar *locale = NULL;
+	gchar **key_array;
+	gsize len;
+	gchar *locale_temp;
+	static GPtrArray *locale_array = NULL;
 
 	key = g_key_file_new ();
 	ret = g_key_file_load_from_file (key, filename, G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
@@ -107,6 +126,16 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 		pk_error ("bad!!");
 	}
 
+	/* get this specific locale list */
+	key_array = g_key_file_get_keys (key, G_KEY_FILE_DESKTOP_GROUP, &len, NULL);
+	locale_array = g_ptr_array_new ();
+	for (i=0; i<len; i++) {
+		/* set the locale */
+		locale_temp = pk_import_get_locale (key_array[i]);
+		g_ptr_array_add (locale_array, g_strdup (locale_temp));
+	}
+	g_strfreev (key_array);
+
 	g_print ("PackageName:\t%s\t[", package_name);
 
 	/* get the default entry */
@@ -142,6 +171,7 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
 		}
 		g_free (name);
 	}
+	g_ptr_array_free (locale_array, TRUE);
 	g_free (name_unlocalised);
 	g_print ("]\n");
 
@@ -222,8 +252,6 @@ main (int argc, char *argv[])
 
 	pk_debug_init (verbose);
 
-	locale_array = pk_import_get_locale_list ();
-
 	/* set defaults */
 	if (desktop_location == NULL) {
 		desktop_location = PK_IMPORT_APPLICATIONSDIR;
@@ -240,7 +268,6 @@ main (int argc, char *argv[])
 	pk_desktop_process_directory (desktop_location);
 
 out:
-	g_ptr_array_free (locale_array, TRUE);
 	g_object_unref (extra);
 	g_object_unref (client);
 	return 0;
commit e3333bd2589bb431206e2553e5b98de51cd483ca
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 17:38:22 2008 +0000

    update some screenshots with the new tools

diff --git a/docs/html/img/pk-application-groups.png b/docs/html/img/pk-application-groups.png
index 98fa802..6798875 100644
Binary files a/docs/html/img/pk-application-groups.png and b/docs/html/img/pk-application-groups.png differ
diff --git a/docs/html/img/pk-application-search.png b/docs/html/img/pk-application-search.png
index 03ab912..daa1376 100644
Binary files a/docs/html/img/pk-application-search.png and b/docs/html/img/pk-application-search.png differ
diff --git a/docs/html/img/pk-updates-overview.png b/docs/html/img/pk-updates-overview.png
index 464e18b..3175ddb 100644
Binary files a/docs/html/img/pk-updates-overview.png and b/docs/html/img/pk-updates-overview.png differ
commit d22be529c8b9c8bc0be7fe86d04aa1b4d646f1a8
Merge: 1a5acb6... b9edb51...
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Mar 24 13:37:17 2008 -0400

    Merge branch 'master' of git+ssh://rnorwood@git.packagekit.org/srv/git/PackageKit

commit 5b2306ac54d5ed262291bf1cfc567b39362aa3eb
Merge: 94bb6c9... d22be52...
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Mar 24 17:37:12 2008 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 1a5acb6fdd9848ec3c06b66edb364626a58f0d5f
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Mar 24 13:32:54 2008 -0400

    Add some new licenses to the free/nonfree list - in the .h file as well.

diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 86a4bcc..dfaaf60 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -311,6 +311,7 @@ typedef enum {
 	PK_LICENSE_ENUM_GLIDE,
 	PK_LICENSE_ENUM_AFL,
 	PK_LICENSE_ENUM_AMPAS_BSD,
+	PK_LICENSE_ENUM_AMAZON_DSL,
 	PK_LICENSE_ENUM_ADOBE,
 	PK_LICENSE_ENUM_AGPLV1,
 	PK_LICENSE_ENUM_AGPLV3,
@@ -332,6 +333,7 @@ typedef enum {
 	PK_LICENSE_ENUM_COPYRIGHT_ONLY,
 	PK_LICENSE_ENUM_CRYPTIX,
 	PK_LICENSE_ENUM_CRYSTAL_STACKER,
+	PK_LICENSE_ENUM_DOC,
 	PK_LICENSE_ENUM_WTFPL,
 	PK_LICENSE_ENUM_EPL,
 	PK_LICENSE_ENUM_ECOS,
@@ -369,6 +371,7 @@ typedef enum {
 	PK_LICENSE_ENUM_NCSA,
 	PK_LICENSE_ENUM_NGPL,
 	PK_LICENSE_ENUM_NOSL,
+	PK_LICENSE_ENUM_NETCDF,
 	PK_LICENSE_ENUM_NETSCAPE,
 	PK_LICENSE_ENUM_NOKIA,
 	PK_LICENSE_ENUM_OPENLDAP,
@@ -386,6 +389,7 @@ typedef enum {
 	PK_LICENSE_ENUM_QPL,
 	PK_LICENSE_ENUM_RPSL,
 	PK_LICENSE_ENUM_RUBY,
+	PK_LICENSE_ENUM_SENDMAIL,
 	PK_LICENSE_ENUM_SLEEPYCAT,
 	PK_LICENSE_ENUM_SLIB,
 	PK_LICENSE_ENUM_SISSL,



More information about the PackageKit mailing list