[PackageKit-commit] packagekit: Branch 'master' - 55 commits

Richard Hughes hughsient at kemper.freedesktop.org
Mon Oct 6 03:08:41 PDT 2008


 NEWS                                            |   46 ++++++
 backends/apt/TODO                               |    3 
 backends/apt/aptDBUSBackend.py                  |   66 +++------
 backends/smart/pk-backend-smart.c               |   16 ++
 backends/smart/smartBackend.py                  |   12 -
 backends/yum/yumBackend.py                      |   21 +-
 backends/yum/yumComps.py                        |    2 
 client/Makefile.am                              |    3 
 configure.ac                                    |    2 
 contrib/PackageKit.spec.in                      |    6 
 contrib/gstreamer-plugin/pk-gstreamer-install.c |    3 
 data/packagekit-background.cron                 |    4 
 data/tests/pk-spawn-dispatcher.py               |    9 +
 docs/html/Makefile.am                           |    1 
 docs/html/img/gpk-application-groups.png        |binary
 docs/html/img/gpk-prefs.png                     |binary
 docs/html/pk-download.html                      |    1 
 docs/html/pk-package-not-found.html             |   21 ++
 etc/Makefile.am                                 |    4 
 etc/Vendor.conf                                 |   63 ++++++++
 libpackagekit/Makefile.am                       |    3 
 libpackagekit/egg-debug.c                       |  101 ++++++++------
 libpackagekit/egg-debug.h                       |    2 
 libpackagekit/pk-client.c                       |   34 ++++
 libpackagekit/pk-control.c                      |    3 
 libpackagekit/pk-enum.c                         |    1 
 libpackagekit/pk-enum.h                         |    1 
 po/de.po                                        |   48 +++---
 python/packagekit/backend.py                    |   12 +
 python/packagekit/daemonBackend.py              |   10 -
 src/Makefile.am                                 |    3 
 src/pk-interface-transaction.xml                |   12 +
 src/pk-main.c                                   |    9 +
 src/pk-spawn.c                                  |   97 ++++++++-----
 src/pk-transaction-list.c                       |  148 +++++++++++++++-----
 src/pk-transaction.c                            |  171 ++++++++++++++----------
 36 files changed, 667 insertions(+), 271 deletions(-)

New commits:
commit 8e7a10065dedce513d24ab3628d29cd2e082d0a3
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Oct 6 11:04:45 2008 +0100

    Release version 0.3.6

diff --git a/NEWS b/NEWS
index c0fef98..1f6e465 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,49 @@
+Version 0.3.6
+~~~~~~~~~~~~~~
+Released: 2008-10-06
+
+Translations:
+ - Updated German Translation (Thomas Spura)
+
+New Features:
+ - Add the GetMimeTypes method to get the MIME types of packages supported (Richard Hughes)
+ - Add a Destroy signal when we destroy the interface (Richard Hughes)
+ - Do a self check in PkTransaction so backends cannot wedge the daemon (Richard Hughes)
+ - Add Vendor.conf so vendors to change the URLs used in the frontend programs (Richard Hughes)
+ - Renice the spawned process so that we don't hog the system when doing automatic updates (Richard Hughes)
+ - Add a way for a big company to change the name of the vendor enumerated group (Richard Hughes)
+
+Bugfixes:
+ - Remove items about to be run from the transaction list without crashing (Richard Hughes)
+ - Use a 64 bit codec suffix for the codec provides on 64 bit machines (Richard Hughes)
+ - Make the GStreamer helper use proper GStreamer exit codes (Richard Hughes)
+ - Set the default timeout to the maximum as dbus-glib times out after 25 seconds (Richard Hughes)
+ - Fix a theoretical hang where we could try to reuse a exiting instance (Richard Hughes)
+ - Unlock the backend before we send finished on ErrorCode as unlocking may take some time (Richard Hughes)
+ - When we exit the dispatcher with 'exit' ensure we unlock if locked (Richard Hughes)
+ - If the refresh cache fails, don't do the PkRefresh actions (Richard Hughes)
+ - If a caller does GetTid and then crashes, the daemon should timeout the transaction (Richard Hughes)
+ - Use environent variables rather than static instance variables to hold the debugging state,
+   so that we can get access to libpackagekit debugging when linked in (Richard Hughes)
+ - When we query the progress of a transaction, use the cached transaction values rather
+   than querying the backend, as it might not be the transaction actually running (Richard Hughes)
+ - We are allowed to cancel queued (and not running) transactions (Richard Hughes)
+ - Use the correct command names in packagekit-background.cron. Fixes fd#17875 (Richard Hughes)
+ - Catch all errors in a transaction to even catch attribute errors in yum. Fixes fd#17920 (Richard Hughes)
+
+
+Backends:
+ - apt: Fix StateHasChanged call after a cache update (Sebastian Heinlein)
+ - apt: Instead of using the raw codec string in WhatProvides use the one (Sebastian Heinlein)
+ - apt: Add a note about implementing the codec search using debtags (will (Sebastian Heinlein)
+ - apt: Dpkg calls should use the same system root as the apt cache (Sebastian Heinlein)
+ - apt: There is no need to mark the required changes of local package (Sebastian Heinlein)
+ - pisi: Trivial changes for pisi-dispatcher work (S.Çağlar Onur)
+ - smart: Use loader.getInstalled() instead of channel.getType (Anders F Bjorklund)
+ - smart: Implement GetMimeTypes (Anders F Bjorklund)
+ - smart: Restore the backend.reset() that got lost in refactoring (Anders F Bjorklund)
+ - yum: Don't backtrace when we search group on no collections. Fixes rh#465722 (Richard Hughes)
+
 Version 0.3.5
 ~~~~~~~~~~~~~~
 Released: 2008-09-29
diff --git a/configure.ac b/configure.ac
index a3a3326..1903595 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ DEVELOPMENT_RELEASE=no
 # AGE		If libpackagekit can be linked into executables which can be
 # 		built with previous versions of this library. Don't use.
 LT_CURRENT=8
-LT_REVISION=0
+LT_REVISION=1
 LT_AGE=0
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 2ed4c7b..84e9dde 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -76,6 +76,7 @@ Releases are normally once every 1-2 weeks.
 <tr><td>0.3.3</td><td></td><td>2008-09-16</td></tr>
 <tr><td>0.3.4</td><td></td><td>2008-09-22</td></tr>
 <tr><td>0.3.5</td><td></td><td>2008-09-29</td></tr>
+<tr><td>0.3.6</td><td></td><td>2008-10-06</td></tr>
 </table>
 <h3>
 ABI Stable Versions:
commit 7704edc42ce09fee04b7f33d1b7dda4a32fb7199
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Oct 6 09:48:03 2008 +0100

    trivial: update a screenshot

diff --git a/docs/html/img/gpk-application-groups.png b/docs/html/img/gpk-application-groups.png
index c6a83af..94e2609 100644
Binary files a/docs/html/img/gpk-application-groups.png and b/docs/html/img/gpk-application-groups.png differ
commit dfbe8255f9332eda3f03f0615aa573577a8b05fe
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Oct 6 09:37:08 2008 +0100

    yum: don't backtrace when we have no groups and we try to search group on collections. Also sort the percentage charge logic while we are here. Fixes rh#465722

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 056aa74..eac513d 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -342,19 +342,20 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
         Handle the special collection group
         """
         # Fixme: Add some real code.
+        self.percentage(None)
         collections = self.comps.get_meta_packages()
-        self.percentage(20)
+        if len(collections) == 0:
+            self.error(ERROR_GROUP_LIST_INVALID, 'No groups could be found. A cache refresh should fix this.')
 
-        step = int(800/len(collections))
-        print step
         pct = 20
-        i = 0
+        old_pct = -1;
+        step = (100.0 - pct) / len(collections)
         for col in collections:
-            i += 1
-            if i % 10 == 0:
-                pct += step
-                self.percentage(pct)
             self._show_meta_package(col, fltlist)
+            pct += step
+            if int(pct) != int(old_pct):
+                self.percentage(pct)
+                old_pct = pct
         self.percentage(100)
 
     def _show_meta_package(self, grpid, fltlist):
commit bb9ab930bc2c72fd6509c2bbbdca2d63da690511
Merge: 1c4d67c... bd9e5ef...
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Mon Oct 6 05:48:53 2008 +0200

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

commit 1c4d67c5f417319fc02dd0a2fc6b2ce5255f42c9
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Mon Oct 6 05:29:58 2008 +0200

    APT: There is no need to mark the required changes of local package
    files twice, since this is already done by debfile

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index c496786..61a5137 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1254,7 +1254,6 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self.AllowCancel(False)
         self.PercentageChanged(0)
         self._check_init(prange=(0,10))
-        dependencies = []
         packages = []
         # Collect all dependencies which need to be installed
         self.StatusChanged(STATUS_DEP_RESOLVE)
@@ -1274,26 +1273,14 @@ class PackageKitAptBackend(PackageKitBaseBackend):
                                "before: %s" % remove)
                 self.Finished(EXIT_FAILED)
                 return
-            dependencies.extend(install)
-        # Install all dependecies before
-        if len(dependencies) > 0:
-            try:
-                for dep in dependencies:
-                    self._cache[dep].markInstall()
-            except:
-                self._cache.clear()
-                self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED, "")
-                self.Finished(EXIT_FAILED)
-                return
-            if not self._commit_changes((10,25), (25,50)): return False
-        # Check for later available packages
-        for deb in packages:
-            # Check if there is a newer version in the cache
             if deb.compareToVersionInCache() == debfile.VERSION_OUTDATED:
                 self.Message(MESSAGE_NEWER_PACKAGE_EXISTS, 
                              "There is a later version of %s "
                              "available in the repositories." % deb.pkgname)
-        # Install the Debian package files
+        if len(self._cache.getChanges()) > 0 and not \
+           self._commit_changes((10,25), (25,50)): 
+            return False
+       # Install the Debian package files
         d = PackageKitDpkgInstallProgress(self)
         try:
             d.startUpdate()
commit bd9e5ef13425d00f77f0eb31f21c87290043f341
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Oct 5 23:38:50 2008 +0100

    bugfix: catch all errors in a yum transaction to even catch attribute and syntax errors in yum. Fixes fd#17920

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index b70ad09..056aa74 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1305,6 +1305,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
             rc, msgs =  self.yumbase.buildTransaction()
         except yum.Errors.RepoError, e:
             self.error(ERROR_REPO_NOT_AVAILABLE, str(e))
+        except:
+            self.error(ERROR_INTERNAL_ERROR, str(e))
         if rc != 2:
             self.error(ERROR_DEP_RESOLUTION_FAILED, _format_msgs(msgs))
         else:
@@ -1351,6 +1353,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
                     self.error(ERROR_PACKAGE_CONFLICTS, message)
                 else:
                     self.error(ERROR_TRANSACTION_ERROR, message)
+            except:
+                self.error(ERROR_INTERNAL_ERROR, str(e))
 
     def remove_packages(self, allowdep, package_ids):
         '''
commit 7199b7b9e8fe4dfb31c8515e95aae55032d178c7
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Oct 5 18:35:21 2008 +0100

    bugfix: use the correct command names in packagekit-background.cron to fix fd#17875

diff --git a/data/packagekit-background.cron b/data/packagekit-background.cron
index 0bce800..c39084e 100755
--- a/data/packagekit-background.cron
+++ b/data/packagekit-background.cron
@@ -26,9 +26,9 @@ sleep $RANDOM
 
 # do action
 if [ "$CHECK_ONLY" == "yes" ]; then
-	pkcon get updates > $PKTMP
+	pkcon get-updates > $PKTMP
 else
-	pkcon update-system > $PKTMP
+	pkcon update > $PKTMP
 fi
 
 # send email
commit 249182898f3c91a5c4bc774c9a1a0d265377fa10
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sun Oct 5 06:07:51 2008 +0200

    APT: Dpkg calls should use the same system root as the apt cache

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 8e4b4b3..c496786 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -254,8 +254,10 @@ class DpkgInstallProgress(apt.progress.InstallProgress):
         """
         Run "dpkg --configure -a"
         """
-        cmd = ["/usr/bin/dpkg", "--status-fd", str(self.writefd), 
-               "--force-confdef", "--force-confold", "--configure", "-a"]
+        cmd = ["/usr/bin/dpkg", "--status-fd", str(self.writefd),
+               "--root", apt_pkg.Config["Dir"],
+               "--force-confdef", "--force-confold", 
+               "--configure", "-a"]
         self.run(cmd)
 
     def install(self, filenames):
@@ -263,7 +265,8 @@ class DpkgInstallProgress(apt.progress.InstallProgress):
         Install the given package using a dpkg command line call
         """
         cmd = ["/usr/bin/dpkg", "--force-confdef", "--force-confold",
-               "--status-fd", str(self.writefd), "-i"]
+               "--status-fd", str(self.writefd), 
+               "--root", apt_pkg.Config["Dir"], "-i"]
         cmd.extend(map(lambda f: str(f), filenames))
         self.run(cmd)
 
commit 0b851b58fb6e7a5db760bbbcc4c2236c9000dad9
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Oct 4 21:27:52 2008 +0100

    trivial: update screenshot

diff --git a/docs/html/img/gpk-prefs.png b/docs/html/img/gpk-prefs.png
index 25a2cb0..4c1ed82 100644
Binary files a/docs/html/img/gpk-prefs.png and b/docs/html/img/gpk-prefs.png differ
commit 3903a28a56888a3d6ce9bcb6cd1da32e899cf06b
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Oct 4 21:22:54 2008 +0100

    API addition: add a Destroy signal when we destroy the interface, else a client has no idea if it's safe to call into the interface. Nothing uses this yet.

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 2f13620..24e56e1 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -125,6 +125,7 @@ typedef enum {
 	PK_CLIENT_CALLER_ACTIVE_CHANGED,
 	PK_CLIENT_REPO_DETAIL,
 	PK_CLIENT_ALLOW_CANCEL,
+	PK_CLIENT_DESTROY,
 	PK_CLIENT_LAST_SIGNAL
 } PkSignals;
 
@@ -477,6 +478,17 @@ pk_client_get_package_list (PkClient *client)
 }
 
 /**
+ * pk_client_destroy_cb:
+ */
+static void
+pk_client_destroy_cb (DBusGProxy *proxy, PkClient *client)
+{
+	g_return_if_fail (PK_IS_CLIENT (client));
+	egg_debug ("emit destroy %s", client->priv->tid);
+	g_signal_emit (client, signals [PK_CLIENT_DESTROY], 0);
+}
+
+/**
  * pk_client_finished_cb:
  */
 static void
@@ -3350,6 +3362,7 @@ pk_client_set_tid (PkClient *client, const gchar *tid, GError **error)
 	dbus_g_proxy_add_signal (proxy, "Message", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
 	dbus_g_proxy_add_signal (proxy, "CallerActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
 	dbus_g_proxy_add_signal (proxy, "AllowCancel", G_TYPE_BOOLEAN, G_TYPE_INVALID);
+	dbus_g_proxy_add_signal (proxy, "Destroy", G_TYPE_INVALID);
 
 	dbus_g_proxy_connect_signal (proxy, "Finished",
 				     G_CALLBACK (pk_client_finished_cb), client, NULL);
@@ -3385,6 +3398,8 @@ pk_client_set_tid (PkClient *client, const gchar *tid, GError **error)
 				     G_CALLBACK (pk_client_caller_active_changed_cb), client, NULL);
 	dbus_g_proxy_connect_signal (proxy, "AllowCancel",
 				     G_CALLBACK (pk_client_allow_cancel_cb), client, NULL);
+	dbus_g_proxy_connect_signal (proxy, "Destroy",
+				     G_CALLBACK (pk_client_destroy_cb), client, NULL);
 	client->priv->proxy = proxy;
 
 	return TRUE;
@@ -3671,6 +3686,19 @@ pk_client_class_init (PkClientClass *klass)
 			      NULL, NULL, pk_marshal_VOID__UINT_UINT,
 			      G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
 
+	/**
+	 * PkClient::destroy:
+	 * @client: the #PkClient instance that emitted the signal
+	 *
+	 * The ::destroy signal is emitted when the transaction has been
+	 * destroyed and is no longer available for use.
+	 **/
+	signals [PK_CLIENT_DESTROY] =
+		g_signal_new ("destroy",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (PkClientClass, finished),
+			      NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+
 	g_type_class_add_private (klass, sizeof (PkClientPrivate));
 }
 
@@ -3733,6 +3761,8 @@ pk_client_disconnect_proxy (PkClient *client)
 					G_CALLBACK (pk_client_caller_active_changed_cb), client);
 	dbus_g_proxy_disconnect_signal (client->priv->proxy, "AllowCancel",
 				        G_CALLBACK (pk_client_allow_cancel_cb), client);
+	dbus_g_proxy_disconnect_signal (client->priv->proxy, "Destroy",
+				        G_CALLBACK (pk_client_destroy_cb), client);
 	g_object_unref (G_OBJECT (client->priv->proxy));
 	client->priv->proxy = NULL;
 	return TRUE;
diff --git a/src/pk-interface-transaction.xml b/src/pk-interface-transaction.xml
index 9c087de..d86d5a3 100644
--- a/src/pk-interface-transaction.xml
+++ b/src/pk-interface-transaction.xml
@@ -2092,6 +2092,18 @@
       </arg>
     </signal>
 
+    <!--*****************************************************************************************-->
+    <signal name="Destroy">
+      <doc:doc>
+        <doc:description>
+          <doc:para>
+            This signal is sent when the transaction has been destroyed and is
+            no longer available for use.
+          </doc:para>
+        </doc:description>
+      </doc:doc>
+    </signal>
+
   </interface>
 </node>
 
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 097f3eb..903513a 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -170,6 +170,7 @@ enum {
 	PK_TRANSACTION_STATUS_CHANGED,
 	PK_TRANSACTION_TRANSACTION,
 	PK_TRANSACTION_UPDATE_DETAIL,
+	PK_TRANSACTION_DESTROY,
 	PK_TRANSACTION_LAST_SIGNAL
 };
 
@@ -3730,6 +3731,10 @@ pk_transaction_class_init (PkTransactionClass *klass)
 			      G_TYPE_NONE, 12, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
 			      G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
 			      G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+	signals [PK_TRANSACTION_DESTROY] =
+		g_signal_new ("destroy",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
 	g_type_class_add_private (klass, sizeof (PkTransactionPrivate));
 }
@@ -3802,6 +3807,10 @@ pk_transaction_finalize (GObject *object)
 	transaction = PK_TRANSACTION (object);
 	g_return_if_fail (transaction->priv != NULL);
 
+	/* send signal to clients that we are about to be destroyed */
+	egg_debug ("emitting destroy %s", transaction->priv->tid);
+	g_signal_emit (transaction, signals [PK_TRANSACTION_DESTROY], 0);
+
 	g_free (transaction->priv->last_package_id);
 	g_free (transaction->priv->dbus_name);
 	g_free (transaction->priv->locale);
commit c770a425fb9e28b0878a34a362da8714300d263e
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Oct 4 21:12:47 2008 +0100

    bugfix: we are allowed to cancel queued (and not running) transactions, and make sure the frontend shows the right thing when we do

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index a48bf8d..097f3eb 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -592,6 +592,10 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 		g_object_unref (refresh);
 	}
 
+	/* if we did not send this, ensure the GUI has the right state */
+	if (transaction->priv->allow_cancel)
+		pk_transaction_allow_cancel_emit (transaction, FALSE);
+
 	/* we should get no more from the backend with this tid */
 	transaction->priv->finished = TRUE;
 
@@ -976,6 +980,7 @@ pk_transaction_set_running (PkTransaction *transaction)
 	/* mark running */
 	transaction->priv->running = TRUE;
 	transaction->priv->has_been_run = TRUE;
+	transaction->priv->allow_cancel = FALSE;
 
 	/* set all possible arguments for backend */
 	store = pk_backend_get_store (priv->backend);
@@ -1356,8 +1361,11 @@ pk_transaction_cancel (PkTransaction *transaction, GError **error)
 
 	/* if it's never been run, just remove this transaction from the list */
 	if (!transaction->priv->has_been_run) {
-		pk_transaction_list_remove (transaction->priv->transaction_list,
-					    transaction->priv->tid);
+		pk_transaction_progress_changed_emit (transaction, 100, 100, 0, 0);
+		pk_transaction_allow_cancel_emit (transaction, FALSE);
+		pk_transaction_status_changed_emit (transaction, PK_STATUS_ENUM_FINISHED);
+		pk_transaction_finished_emit (transaction, PK_EXIT_ENUM_CANCELLED, 0);
+		pk_transaction_list_remove (transaction->priv->transaction_list, transaction->priv->tid);
 		return TRUE;
 	}
 
@@ -2023,8 +2031,7 @@ pk_transaction_get_role (PkTransaction *transaction,
  * pk_transaction_get_status:
  **/
 gboolean
-pk_transaction_get_status (PkTransaction *transaction,
-			   const gchar **status, GError **error)
+pk_transaction_get_status (PkTransaction *transaction, const gchar **status, GError **error)
 {
 	g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
 	g_return_val_if_fail (transaction->priv->tid != NULL, FALSE);
@@ -3738,7 +3745,7 @@ pk_transaction_init (PkTransaction *transaction)
 	transaction->priv->finished = FALSE;
 	transaction->priv->running = FALSE;
 	transaction->priv->has_been_run = FALSE;
-	transaction->priv->allow_cancel = FALSE;
+	transaction->priv->allow_cancel = TRUE;
 	transaction->priv->emit_eula_required = FALSE;
 	transaction->priv->emit_signature_required = FALSE;
 	transaction->priv->dbus_name = NULL;
commit 4aa8bf6ee7ceb4afd6ba4697d06cfec61d4f377d
Author: Richard Hughes <richard at hughsie.com>
Date:   Sat Oct 4 20:57:54 2008 +0100

    bugfix: when we query the progress of a transaction, use the cached transaction values rather than querying the backend, as it might not be the transaction actually running at the moment. Also tidy up the signal emission while we are here

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 20b7c60..a48bf8d 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -87,6 +87,10 @@ struct PkTransactionPrivate
 {
 	PkRoleEnum		 role;
 	PkStatusEnum		 status;
+	guint			 percentage;
+	guint			 subpercentage;
+	guint			 elapsed;
+	guint			 remaining;
 	gboolean		 finished;
 	gboolean		 running;
 	gboolean		 has_been_run;
@@ -359,15 +363,31 @@ pk_transaction_finish_invalidate_caches (PkTransaction *transaction)
 }
 
 /**
- * pk_transaction_allow_cancel_cb:
+ * pk_transaction_progress_changed_emit:
  **/
 static void
-pk_transaction_allow_cancel_cb (PkBackend *backend, gboolean allow_cancel, PkTransaction *transaction)
+pk_transaction_progress_changed_emit (PkTransaction *transaction, guint percentage, guint subpercentage, guint elapsed, guint remaining)
+{
+	g_return_if_fail (PK_IS_TRANSACTION (transaction));
+
+	/* save so we can do GetProgress on a queued or finished transaction */
+	transaction->priv->percentage = percentage;
+	transaction->priv->subpercentage = subpercentage;
+	transaction->priv->elapsed = elapsed;
+	transaction->priv->remaining = remaining;
+
+	egg_debug ("emitting percentage-changed %i, %i, %i, %i", percentage, subpercentage, elapsed, remaining);
+	g_signal_emit (transaction, signals [PK_TRANSACTION_PROGRESS_CHANGED], 0, percentage, subpercentage, elapsed, remaining);
+}
+
+/**
+ * pk_transaction_allow_cancel_emit:
+ **/
+static void
+pk_transaction_allow_cancel_emit (PkTransaction *transaction, gboolean allow_cancel)
 {
 	g_return_if_fail (PK_IS_TRANSACTION (transaction));
-	g_return_if_fail (transaction->priv->tid != NULL);
 
-	egg_debug ("AllowCancel now %i", allow_cancel);
 	transaction->priv->allow_cancel = allow_cancel;
 
 	/* remove or add the hal inhibit */
@@ -376,11 +396,53 @@ pk_transaction_allow_cancel_cb (PkBackend *backend, gboolean allow_cancel, PkTra
 	else
 		pk_inhibit_add (transaction->priv->inhibit, transaction);
 
-	egg_debug ("emitting allow-interrpt %i", allow_cancel);
+	egg_debug ("emitting allow-cancel %i", allow_cancel);
 	g_signal_emit (transaction, signals [PK_TRANSACTION_ALLOW_CANCEL], 0, allow_cancel);
 }
 
 /**
+ * pk_transaction_status_changed_emit:
+ **/
+static void
+pk_transaction_status_changed_emit (PkTransaction *transaction, PkStatusEnum status)
+{
+	const gchar *status_text;
+
+	g_return_if_fail (PK_IS_TRANSACTION (transaction));
+	g_return_if_fail (transaction->priv->tid != NULL);
+
+	transaction->priv->status = status;
+	status_text = pk_status_enum_to_text (status);
+
+	egg_debug ("emitting status-changed '%s'", status_text);
+	g_signal_emit (transaction, signals [PK_TRANSACTION_STATUS_CHANGED], 0, status_text);
+}
+
+/**
+ * pk_transaction_finished_emit:
+ **/
+static void
+pk_transaction_finished_emit (PkTransaction *transaction, PkExitEnum exit, guint time)
+{
+	const gchar *exit_text;
+	exit_text = pk_exit_enum_to_text (exit);
+	egg_debug ("emitting finished '%s', %i", exit_text, time);
+	g_signal_emit (transaction, signals [PK_TRANSACTION_FINISHED], 0, exit_text, time);
+}
+
+/**
+ * pk_transaction_allow_cancel_cb:
+ **/
+static void
+pk_transaction_allow_cancel_cb (PkBackend *backend, gboolean allow_cancel, PkTransaction *transaction)
+{
+	g_return_if_fail (PK_IS_TRANSACTION (transaction));
+	g_return_if_fail (transaction->priv->tid != NULL);
+
+	pk_transaction_allow_cancel_emit (transaction, allow_cancel);
+}
+
+/**
  * pk_transaction_caller_active_changed_cb:
  **/
 static void
@@ -475,7 +537,6 @@ static void
 pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *transaction)
 {
 	gboolean ret;
-	const gchar *exit_text;
 	guint time;
 	gchar *packages;
 
@@ -583,9 +644,7 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 	pk_inhibit_remove (transaction->priv->inhibit, transaction);
 
 	/* we emit last, as other backends will be running very soon after us, and we don't want to be notified */
-	exit_text = pk_exit_enum_to_text (exit);
-	egg_debug ("emitting finished '%s', %i", exit_text, time);
-	g_signal_emit (transaction, signals [PK_TRANSACTION_FINISHED], 0, exit_text, time);
+	pk_transaction_finished_emit (transaction, exit, time);
 }
 
 /**
@@ -684,10 +743,7 @@ pk_transaction_progress_changed_cb (PkBackend *backend, guint percentage, guint
 	g_return_if_fail (PK_IS_TRANSACTION (transaction));
 	g_return_if_fail (transaction->priv->tid != NULL);
 
-	egg_debug ("emitting percentage-changed %i, %i, %i, %i",
-		  percentage, subpercentage, elapsed, remaining);
-	g_signal_emit (transaction, signals [PK_TRANSACTION_PROGRESS_CHANGED], 0,
-		       percentage, subpercentage, elapsed, remaining);
+	pk_transaction_progress_changed_emit (transaction, percentage, subpercentage, elapsed, remaining);
 }
 
 /**
@@ -774,8 +830,6 @@ pk_transaction_require_restart_cb (PkBackend *backend, PkRestartEnum restart, co
 static void
 pk_transaction_status_changed_cb (PkBackend *backend, PkStatusEnum status, PkTransaction *transaction)
 {
-	const gchar *status_text;
-
 	g_return_if_fail (PK_IS_TRANSACTION (transaction));
 	g_return_if_fail (transaction->priv->tid != NULL);
 
@@ -785,11 +839,7 @@ pk_transaction_status_changed_cb (PkBackend *backend, PkStatusEnum status, PkTra
 		return;
 	}
 
-	transaction->priv->status = status;
-	status_text = pk_status_enum_to_text (status);
-
-	egg_debug ("emitting status-changed '%s'", status_text);
-	g_signal_emit (transaction, signals [PK_TRANSACTION_STATUS_CHANGED], 0, status_text);
+	pk_transaction_status_changed_emit (transaction, status);
 }
 
 /**
@@ -1099,10 +1149,7 @@ pk_transaction_commit (PkTransaction *transaction)
 static gboolean
 pk_transaction_finished_idle_cb (PkTransaction *transaction)
 {
-	const gchar *exit_text;
-	exit_text = pk_exit_enum_to_text (PK_EXIT_ENUM_SUCCESS);
-	egg_debug ("emitting finished '%s'", exit_text);
-	g_signal_emit (transaction, signals [PK_TRANSACTION_FINISHED], 0, exit_text, 0);
+	pk_transaction_finished_emit (transaction, PK_EXIT_ENUM_SUCCESS, 0);
 	return FALSE;
 }
 
@@ -1417,7 +1464,6 @@ pk_transaction_download_packages (PkTransaction *transaction, gchar **package_id
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
 	transaction->priv->cached_directory = g_strdup (directory);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_DOWNLOAD_PACKAGES);
 
 	/* try to commit this */
@@ -1508,7 +1554,6 @@ pk_transaction_get_depends (PkTransaction *transaction, const gchar *filter, gch
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
 	transaction->priv->cached_force = recursive;
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_DEPENDS);
 
 	/* try to commit this */
@@ -1573,7 +1618,6 @@ pk_transaction_get_details (PkTransaction *transaction, gchar **package_ids, DBu
 
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_DETAILS);
 
 	/* try to commit this */
@@ -1623,7 +1667,6 @@ pk_transaction_get_distro_upgrades (PkTransaction *transaction, DBusGMethodInvoc
 	}
 
 	/* save so we can run later */
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_DISTRO_UPGRADES);
 
 	/* try to commit this */
@@ -1689,7 +1732,6 @@ pk_transaction_get_files (PkTransaction *transaction, gchar **package_ids, DBusG
 
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_FILES);
 
 	/* try to commit this */
@@ -1747,7 +1789,6 @@ pk_transaction_get_packages (PkTransaction *transaction, const gchar *filter, DB
 
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_PACKAGES);
 
 	/* try to commit this */
@@ -1809,19 +1850,15 @@ pk_transaction_get_progress (PkTransaction *transaction,
 			     guint *percentage, guint *subpercentage,
 			     guint *elapsed, guint *remaining, GError **error)
 {
-	gboolean ret;
-
 	g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
 	g_return_val_if_fail (transaction->priv->tid != NULL, FALSE);
 
-	egg_debug ("GetProgress method called");
+	egg_debug ("GetProgress method called, using cached values");
+	*percentage = transaction->priv->percentage;
+	*subpercentage = transaction->priv->subpercentage;
+	*elapsed = transaction->priv->elapsed;
+	*remaining = transaction->priv->remaining;
 
-	ret = pk_backend_get_progress (transaction->priv->backend, percentage, subpercentage, elapsed, remaining);
-	if (!ret) {
-		g_set_error (error, PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INVALID_STATE,
-			     "No progress data available");
-		return FALSE;
-	}
 	return TRUE;
 }
 
@@ -1866,7 +1903,6 @@ pk_transaction_get_repo_list (PkTransaction *transaction, const gchar *filter, D
 
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_REPO_LIST);
 
 	/* try to commit this */
@@ -1941,7 +1977,6 @@ pk_transaction_get_requires (PkTransaction *transaction, const gchar *filter, gc
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
 	transaction->priv->cached_force = recursive;
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_REQUIRES);
 
 	/* try to commit this */
@@ -2059,7 +2094,6 @@ pk_transaction_get_update_detail (PkTransaction *transaction, gchar **package_id
 
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_UPDATE_DETAIL);
 
 	/* try and reuse cache */
@@ -2167,7 +2201,6 @@ pk_transaction_get_updates (PkTransaction *transaction, const gchar *filter, DBu
 
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_GET_UPDATES);
 
 	/* try and reuse cache */
@@ -2466,7 +2499,6 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
 	/* save so we can run later */
 	transaction->priv->cached_trusted = trusted;
 	transaction->priv->cached_full_paths = g_strdupv (full_paths);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_FILES);
 
 	/* try to commit this */
@@ -2541,7 +2573,6 @@ pk_transaction_install_packages (PkTransaction *transaction, gchar **package_ids
 
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_PACKAGES);
 
 	/* try to commit this */
@@ -2621,7 +2652,6 @@ pk_transaction_install_signature (PkTransaction *transaction, const gchar *sig_t
 	/* save so we can run later */
 	transaction->priv->cached_package_id = g_strdup (package_id);
 	transaction->priv->cached_key_id = g_strdup (key_id);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_SIGNATURE);
 
 	/* try to commit this */
@@ -2698,7 +2728,6 @@ pk_transaction_refresh_cache (PkTransaction *transaction, gboolean force, DBusGM
 
 	/* save so we can run later */
 	transaction->priv->cached_force = force;
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_REFRESH_CACHE);
 
 	/* try to commit this */
@@ -2774,7 +2803,6 @@ pk_transaction_remove_packages (PkTransaction *transaction, gchar **package_ids,
 	/* save so we can run later */
 	transaction->priv->cached_allow_deps = allow_deps;
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_REMOVE_PACKAGES);
 
 	/* try to commit this */
@@ -2844,7 +2872,6 @@ pk_transaction_repo_enable (PkTransaction *transaction, const gchar *repo_id, gb
 	/* save so we can run later */
 	transaction->priv->cached_repo_id = g_strdup (repo_id);
 	transaction->priv->cached_enabled = enabled;
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_REPO_ENABLE);
 
 	/* try to commit this */
@@ -2916,7 +2943,6 @@ pk_transaction_repo_set_data (PkTransaction *transaction, const gchar *repo_id,
 	transaction->priv->cached_repo_id = g_strdup (repo_id);
 	transaction->priv->cached_parameter = g_strdup (parameter);
 	transaction->priv->cached_value = g_strdup (value);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_REPO_SET_DATA);
 
 	/* try to commit this */
@@ -2993,7 +3019,6 @@ pk_transaction_resolve (PkTransaction *transaction, const gchar *filter,
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (packages);
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_RESOLVE);
 
 	/* try to commit this */
@@ -3062,7 +3087,6 @@ pk_transaction_rollback (PkTransaction *transaction, const gchar *transaction_id
 
 	/* save so we can run later */
 	transaction->priv->cached_transaction_id = g_strdup (transaction_id);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_ROLLBACK);
 
 	/* try to commit this */
@@ -3129,7 +3153,6 @@ pk_transaction_search_details (PkTransaction *transaction, const gchar *filter,
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_search = g_strdup (search);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_SEARCH_DETAILS);
 
 	/* try to commit this */
@@ -3196,7 +3219,6 @@ pk_transaction_search_file (PkTransaction *transaction, const gchar *filter,
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_search = g_strdup (search);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_SEARCH_FILE);
 
 	/* try to commit this */
@@ -3263,7 +3285,6 @@ pk_transaction_search_group (PkTransaction *transaction, const gchar *filter,
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_search = g_strdup (search);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_SEARCH_GROUP);
 
 	/* try to commit this */
@@ -3330,7 +3351,6 @@ pk_transaction_search_name (PkTransaction *transaction, const gchar *filter,
 	/* save so we can run later */
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_search = g_strdup (search);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_SEARCH_NAME);
 
 	/* try to commit this */
@@ -3364,7 +3384,6 @@ pk_transaction_service_pack (PkTransaction *transaction, const gchar *location,
 	/* save so we can run later */
 	transaction->priv->cached_enabled = enabled;
 	transaction->priv->cached_full_path = g_strdup (location);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_SERVICE_PACK);
 	return TRUE;
 }
@@ -3447,7 +3466,6 @@ pk_transaction_update_packages (PkTransaction *transaction, gchar **package_ids,
 
 	/* save so we can run later */
 	transaction->priv->cached_package_ids = g_strdupv (package_ids);
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_UPDATE_PACKAGES);
 
 	/* try to commit this */
@@ -3512,7 +3530,6 @@ pk_transaction_update_system (PkTransaction *transaction, DBusGMethodInvocation
 		return;
 	}
 
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_UPDATE_SYSTEM);
 
 	/* try to commit this */
@@ -3589,7 +3606,6 @@ pk_transaction_what_provides (PkTransaction *transaction, const gchar *filter, c
 	transaction->priv->cached_filters = pk_filter_bitfield_from_text (filter);
 	transaction->priv->cached_search = g_strdup (search);
 	transaction->priv->cached_provides = provides;
-	transaction->priv->status = PK_STATUS_ENUM_WAIT;
 	pk_transaction_set_role (transaction, PK_ROLE_ENUM_WHAT_PROVIDES);
 
 	/* try to commit this */
@@ -3742,7 +3758,11 @@ pk_transaction_init (PkTransaction *transaction)
 	transaction->priv->tid = NULL;
 	transaction->priv->locale = NULL;
 	transaction->priv->role = PK_ROLE_ENUM_UNKNOWN;
-
+	transaction->priv->status = PK_STATUS_ENUM_WAIT;
+	transaction->priv->percentage = PK_BACKEND_PERCENTAGE_INVALID;
+	transaction->priv->subpercentage = PK_BACKEND_PERCENTAGE_INVALID;
+	transaction->priv->elapsed = 0;
+	transaction->priv->remaining = 0;
 	transaction->priv->backend = pk_backend_new ();
 	transaction->priv->security = pk_security_new ();
 	transaction->priv->cache = pk_cache_new ();
commit d42ea23f39b2572a622389902186209404a2fc6c
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Sat Oct 4 05:31:24 2008 +0200

    Trivial fix in Python daemon backend: Use a string array instead of a
    string in Resolve call

diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 8d33b6e..2b51277 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -609,15 +609,15 @@ class PackageKitBaseBackend(dbus.service.Object):
         self.Finished(EXIT_FAILED)
 
     @dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
-                         in_signature='ss', out_signature='')
-    def Resolve(self, filters, name):
+                         in_signature='sas', out_signature='')
+    def Resolve(self, filters, names):
         '''
         Implement the {backend}-resolve functionality
         '''
-        pklog.info("Resolve(%s, %s)" % (filters, name))
-        self.doResolve(filters, name)
+        pklog.info("Resolve(%s, %s)" % (filters, names))
+        self.doResolve(filters, names)
 
-    def doResolve(self, filters, name):
+    def doResolve(self, filters, names):
         '''
         Should be replaced in the corresponding backend sub class
         '''
commit 2d6ddc9e01d1bdcb428326c28a8e05c7b9d9d71b
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 17:52:54 2008 +0100

    trivial: save and restore the new debugging state as the daemon does clearenv

diff --git a/src/pk-main.c b/src/pk-main.c
index 9a87470..1b9587b 100644
--- a/src/pk-main.c
+++ b/src/pk-main.c
@@ -182,6 +182,9 @@ main (int argc, char *argv[])
 	PkConf *conf = NULL;
 	GError *error = NULL;
 	GOptionContext *context;
+	const gchar *env_pk_verbose;
+	const gchar *env_pk_console;
+	const gchar *env_pk_logging;
 
 	const GOptionEntry options[] = {
 		{ "backend", '\0', 0, G_OPTION_ARG_STRING, &backend_name,
@@ -250,7 +253,13 @@ main (int argc, char *argv[])
 
 	/* we don't actually need to do this, except it rules out the
 	 * 'it works from the command line but not service activation' bugs */
+	env_pk_verbose = g_getenv (EGG_VERBOSE);
+	env_pk_console = g_getenv (EGG_CONSOLE);
+	env_pk_logging = g_getenv (EGG_LOGGING);
 	clearenv ();
+	g_setenv (EGG_VERBOSE, env_pk_verbose, FALSE);
+	g_setenv (EGG_CONSOLE, env_pk_console, FALSE);
+	g_setenv (EGG_LOGGING, env_pk_logging, FALSE);
 
 	/* get values from the config file */
 	conf = pk_conf_new ();
commit e63cfe7a6e38c894164700c48f395329dd06231a
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 17:05:02 2008 +0100

    bugfix: use environent variables rather than static instance variables to hold the debugging state, so that we can get access to libpackagekit debugging when compiling with external programs

diff --git a/client/Makefile.am b/client/Makefile.am
index 29c369b..e83ba3d 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -15,6 +15,9 @@ INCLUDES =						\
 	-DPK_DATA=\"$(pkgdatadir)\"			\
 	-DPK_DB_DIR=\""$(PK_DB_DIR)"\" 			\
 	-DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\"	\
+	-DEGG_VERBOSE="\"PK_VERBOSE\""			\
+	-DEGG_LOGGING="\"PK_LOGGING\""			\
+	-DEGG_CONSOLE="\"PK_CONSOLE\""			\
 	-I$(top_srcdir)/libpackagekit			\
 	$(NULL)
 
diff --git a/libpackagekit/Makefile.am b/libpackagekit/Makefile.am
index baa6830..25fb1d7 100644
--- a/libpackagekit/Makefile.am
+++ b/libpackagekit/Makefile.am
@@ -9,6 +9,9 @@ INCLUDES = \
 	-I$(top_srcdir)/libpackagekit				\
 	-DPK_DB_DIR=\""$(PK_DB_DIR)"\" 				\
 	-DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\"		\
+	-DEGG_VERBOSE="\"PK_VERBOSE\""			\
+	-DEGG_LOGGING="\"PK_LOGGING\""			\
+	-DEGG_CONSOLE="\"PK_CONSOLE\""			\
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\"			\
 	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
 
diff --git a/libpackagekit/egg-debug.c b/libpackagekit/egg-debug.c
index 2a37397..3920add 100644
--- a/libpackagekit/egg-debug.c
+++ b/libpackagekit/egg-debug.c
@@ -53,24 +53,9 @@
 #define CONSOLE_CYAN		36
 #define CONSOLE_WHITE		37
 
-static gboolean do_verbose = FALSE;	/* if we should print out debugging */
-static gboolean do_logging = FALSE;	/* if we should write to a file */
-static gboolean is_console = FALSE;
 static gint fd = -1;
 
 /**
- * egg_debug_set_logging:
- **/
-void
-egg_debug_set_logging (gboolean enabled)
-{
-	do_logging = enabled;
-	if (enabled) {
-		egg_debug ("now logging to %s", EGG_LOG_FILE);
-	}
-}
-
-/**
  * pk_set_console_mode:
  **/
 static void
@@ -79,9 +64,9 @@ pk_set_console_mode (guint console_code)
 	gchar command[13];
 
 	/* don't put extra commands into logs */
-	if (!is_console) {
+	if (!egg_debug_is_console ())
 		return;
-	}
+
 	/* Command is the control command to the terminal */
 	g_snprintf (command, 13, "%c[%dm", 0x1B, console_code);
 	printf ("%s", command);
@@ -123,21 +108,18 @@ pk_log_line (const gchar *buffer)
 	if (fd == -1) {
 		/* ITS4: ignore, /var/log/foo is owned by root, and this is just debug text */
 		fd = open (EGG_LOG_FILE, O_WRONLY|O_APPEND|O_CREAT, 0777);
-		if (fd == -1) {
+		if (fd == -1)
 			g_error ("could not open log: '%s'", EGG_LOG_FILE);
-		}
 	}
 
 	/* ITS4: ignore, debug text always NULL terminated */
 	count = write (fd, buffer, strlen (buffer));
-	if (count == -1) {
+	if (count == -1)
 		g_warning ("could not write %s", buffer);
-	}
 	/* newline */
 	count = write (fd, "\n", 1);
-	if (count == -1) {
+	if (count == -1)
 		g_warning ("could not write newline");
-	}
 }
 
 /**
@@ -170,7 +152,7 @@ pk_print_line (const gchar *func, const gchar *file, const int line, const gchar
 	pk_set_console_mode (CONSOLE_RESET);
 
 	/* log to a file */
-	if (do_logging) {
+	if (egg_debug_is_logging ()) {
 		pk_log_line (header);
 		pk_log_line (buffer);
 	}
@@ -190,9 +172,8 @@ egg_debug_real (const gchar *func, const gchar *file, const int line, const gcha
 	va_list args;
 	gchar *buffer = NULL;
 
-	if (do_verbose == FALSE) {
+	if (!egg_debug_enabled ())
 		return;
-	}
 
 	va_start (args, format);
 	g_vasprintf (&buffer, format, args);
@@ -212,18 +193,16 @@ egg_warning_real (const gchar *func, const gchar *file, const int line, const gc
 	va_list args;
 	gchar *buffer = NULL;
 
-	if (do_verbose == FALSE) {
+	if (!egg_debug_enabled ())
 		return;
-	}
 
 	va_start (args, format);
 	g_vasprintf (&buffer, format, args);
 	va_end (args);
 
 	/* do extra stuff for a warning */
-	if (!is_console) {
+	if (!egg_debug_is_console ())
 		printf ("*** WARNING ***\n");
-	}
 	pk_print_line (func, file, line, buffer, CONSOLE_RED);
 
 	g_free(buffer);
@@ -243,9 +222,8 @@ egg_error_real (const gchar *func, const gchar *file, const int line, const gcha
 	va_end (args);
 
 	/* do extra stuff for a warning */
-	if (!is_console) {
+	if (!egg_debug_is_console ())
 		printf ("*** ERROR ***\n");
-	}
 	pk_print_line (func, file, line, buffer, CONSOLE_RED);
 	g_free(buffer);
 
@@ -263,7 +241,50 @@ egg_error_real (const gchar *func, const gchar *file, const int line, const gcha
 gboolean
 egg_debug_enabled (void)
 {
-	return do_verbose;
+	const gchar *env;
+	env = g_getenv (EGG_VERBOSE);
+	return (g_strcmp0 (env, "1") == 0);
+}
+
+/**
+ * egg_debug_is_logging:
+ *
+ * Returns: TRUE if we have logging enabled
+ **/
+gboolean
+egg_debug_is_logging (void)
+{
+	const gchar *env;
+	env = g_getenv (EGG_LOGGING);
+	return (g_strcmp0 (env, "1") == 0);
+}
+
+/**
+ * egg_debug_is_console:
+ *
+ * Returns: TRUE if we have debugging enabled
+ **/
+gboolean
+egg_debug_is_console (void)
+{
+	const gchar *env;
+	env = g_getenv (EGG_CONSOLE);
+	return (g_strcmp0 (env, "1") == 0);
+}
+
+/**
+ * egg_debug_set_logging:
+ **/
+void
+egg_debug_set_logging (gboolean enabled)
+{
+	if (enabled)
+		g_setenv (EGG_LOGGING, "1", FALSE);
+	else
+		g_setenv (EGG_LOGGING, "0", FALSE);
+
+	if (egg_debug_is_logging ())
+		egg_debug ("logging to %s", EGG_LOG_FILE);
 }
 
 /**
@@ -273,11 +294,15 @@ egg_debug_enabled (void)
 void
 egg_debug_init (gboolean debug)
 {
-	do_verbose = debug;
 	/* check if we are on console */
-	if (isatty (fileno (stdout)) == 1) {
-		is_console = TRUE;
-	}
-	egg_debug ("Verbose debugging %i (on console %i)", do_verbose, is_console);
+	if (isatty (fileno (stdout)) == 1)
+		g_setenv (EGG_CONSOLE, "1", FALSE);
+	else
+		g_setenv (EGG_CONSOLE, "0", FALSE);
+	if (debug)
+		g_setenv (EGG_VERBOSE, "1", FALSE);
+	else
+		g_setenv (EGG_VERBOSE, "0", FALSE);
+	egg_debug ("Verbose debugging %i (on console %i)%s", egg_debug_enabled (), egg_debug_is_console (), EGG_VERBOSE);
 }
 
diff --git a/libpackagekit/egg-debug.h b/libpackagekit/egg-debug.h
index 9683846..e3df542 100644
--- a/libpackagekit/egg-debug.h
+++ b/libpackagekit/egg-debug.h
@@ -62,6 +62,8 @@ G_BEGIN_DECLS
 void		egg_debug_init			(gboolean	 debug);
 void		egg_debug_set_logging		(gboolean	 enabled);
 gboolean	egg_debug_enabled		(void);
+gboolean	egg_debug_is_logging		(void);
+gboolean	egg_debug_is_console		(void);
 void		egg_debug_backtrace		(void);
 void		egg_debug_real			(const gchar	*func,
 						 const gchar	*file,
diff --git a/src/Makefile.am b/src/Makefile.am
index f44c2b1..bebee18 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,6 +27,9 @@ INCLUDES =						\
 	-DLOCALSTATEDIR=\""$(localstatedir)"\" 		\
 	-DPK_DB_DIR=\""$(PK_DB_DIR)"\" 			\
 	-DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\"	\
+	-DEGG_VERBOSE="\"PK_VERBOSE\""			\
+	-DEGG_LOGGING="\"PK_LOGGING\""			\
+	-DEGG_CONSOLE="\"PK_CONSOLE\""			\
 	-I$(top_srcdir)/libpackagekit			\
 	$(NULL)
 
commit 114bf24027609bf8a3dd8412cdac82334396f58b
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 16:24:42 2008 +0100

    bugfix: what a caller does GetTid and then crashes, the daemon does not timeout the transaction

diff --git a/src/pk-transaction-list.c b/src/pk-transaction-list.c
index bc8fd35..46c8704 100644
--- a/src/pk-transaction-list.c
+++ b/src/pk-transaction-list.c
@@ -56,6 +56,12 @@ static void     pk_transaction_list_finalize	(GObject        *object);
 /* how long the transaction should be queriable after it is finished, in seconds */
 #define PK_TRANSACTION_LIST_KEEP_FINISHED_TIMEOUT	5
 
+/* how long the tid is valid before it's destroyed, in seconds */
+#define PK_TRANSACTION_LIST_CREATE_COMMIT_TIMEOUT	5
+
+/* the interval between each CST, in seconds */
+#define PK_TRANSACTION_WEDGE_CHECK			10
+
 struct PkTransactionListPrivate
 {
 	GPtrArray		*array;
@@ -68,8 +74,11 @@ typedef struct {
 	gboolean		 running;
 	gboolean		 finished;
 	PkTransaction		*transaction;
+	PkTransactionList	*list;
 	gchar			*tid;
+	guint			 remove_id;
 	guint			 idle_id;
+	guint			 commit_id;
 } PkTransactionItem;
 
 enum {
@@ -82,10 +91,6 @@ static guint signals [PK_TRANSACTION_LIST_LAST_SIGNAL] = { 0 };
 G_DEFINE_TYPE (PkTransactionList, pk_transaction_list, G_TYPE_OBJECT)
 static gpointer pk_transaction_list_object = NULL;
 
-/* the interval between each CST */
-#define PK_TRANSACTION_WEDGE_CHECK	10 /* seconds */
-
-
 /**
  * pk_transaction_list_get_from_tid:
  **/
@@ -152,6 +157,13 @@ pk_transaction_list_item_free (PkTransactionItem *item)
 {
 	g_return_if_fail (item != NULL);
 	g_object_unref (item->transaction);
+	if (item->commit_id != 0)
+		g_source_remove (item->commit_id);
+	if (item->idle_id != 0)
+		g_source_remove (item->idle_id);
+	if (item->remove_id != 0)
+		g_source_remove (item->remove_id);
+	g_object_unref (item->list);
 	g_free (item->tid);
 	g_free (item);
 }
@@ -200,6 +212,13 @@ pk_transaction_list_remove (PkTransactionList *tlist, const gchar *tid)
 		egg_debug ("already finished, so waiting to timeout");
 		return FALSE;
 	}
+
+	/* we could be being called externally, so stop the automated callback */
+	if (item->remove_id != 0) {
+		g_source_remove (item->remove_id);
+		item->remove_id = 0;
+	}
+
 	/* check if we are running, or _just_ about to be run */
 	if (item->running) {
 		if (item->idle_id == 0) {
@@ -215,23 +234,14 @@ pk_transaction_list_remove (PkTransactionList *tlist, const gchar *tid)
 	return ret;
 }
 
-/* we need this for the finished data */
-typedef struct {
-	PkTransactionList *tlist;
-	PkTransactionItem *item;
-} PkTransactionFinished;
-
 /**
- * pk_transaction_list_remove_item_timeout:
+ * pk_transaction_list_remove_item_cb:
  **/
 static gboolean
-pk_transaction_list_remove_item_timeout (gpointer data)
+pk_transaction_list_remove_item_cb (PkTransactionItem *item)
 {
-	PkTransactionFinished *finished = (PkTransactionFinished *) data;
-
-	egg_debug ("transaction %s completed, removing", finished->item->tid);
-	pk_transaction_list_remove_internal (finished->tlist, finished->item);
-	g_free (finished);
+	egg_debug ("transaction %s completed, removing", item->tid);
+	pk_transaction_list_remove_internal (item->list, item);
 	return FALSE;
 }
 
@@ -276,7 +286,6 @@ pk_transaction_list_transaction_finished_cb (PkTransaction *transaction, const g
 	guint i;
 	guint length;
 	PkTransactionItem *item;
-	PkTransactionFinished *finished;
 	const gchar *tid;
 
 	g_return_if_fail (PK_IS_TRANSACTION_LIST (tlist));
@@ -292,6 +301,12 @@ pk_transaction_list_transaction_finished_cb (PkTransaction *transaction, const g
 		return;
 	}
 
+	/* we've been 'used' */
+	if (item->commit_id != 0) {
+		g_source_remove (item->commit_id);
+		item->commit_id = 0;
+	}
+
 	egg_debug ("transaction %s completed, marking finished", item->tid);
 	item->running = FALSE;
 	item->finished = TRUE;
@@ -304,10 +319,8 @@ pk_transaction_list_transaction_finished_cb (PkTransaction *transaction, const g
 	g_signal_emit (tlist, signals [PK_TRANSACTION_LIST_CHANGED], 0);
 
 	/* give the client a few seconds to still query the runner */
-	finished = g_new0 (PkTransactionFinished, 1);
-	finished->tlist = tlist;
-	finished->item = item;
-	g_timeout_add_seconds (PK_TRANSACTION_LIST_KEEP_FINISHED_TIMEOUT, pk_transaction_list_remove_item_timeout, finished);
+	item->remove_id = g_timeout_add_seconds (PK_TRANSACTION_LIST_KEEP_FINISHED_TIMEOUT,
+						 (GSourceFunc) pk_transaction_list_remove_item_cb, item);
 
 	/* do the next transaction now if we have another queued */
 	length = tlist->priv->array->len;
@@ -324,6 +337,20 @@ pk_transaction_list_transaction_finished_cb (PkTransaction *transaction, const g
 }
 
 /**
+ * pk_transaction_list_no_commit_cb:
+ **/
+static gboolean
+pk_transaction_list_no_commit_cb (PkTransactionItem *item)
+{
+	egg_warning ("ID %s was not committed in %i seconds!",
+		     item->tid, PK_TRANSACTION_LIST_CREATE_COMMIT_TIMEOUT);
+	pk_transaction_list_remove_internal (item->list, item);
+
+	/* never repeat */
+	return FALSE;
+}
+
+/**
  * pk_transaction_list_create:
  **/
 gboolean
@@ -349,6 +376,10 @@ pk_transaction_list_create (PkTransactionList *tlist, const gchar *tid)
 	item->running = FALSE;
 	item->finished = FALSE;
 	item->transaction = NULL;
+	item->commit_id = 0;
+	item->remove_id = 0;
+	item->idle_id = 0;
+	item->list = g_object_ref (tlist);
 	item->tid = g_strdup (tid);
 
 	/* get another connection */
@@ -369,6 +400,10 @@ pk_transaction_list_create (PkTransactionList *tlist, const gchar *tid)
 	dbus_g_object_type_install_info (PK_TYPE_TRANSACTION, &dbus_glib_pk_transaction_object_info);
 	dbus_g_connection_register_g_object (connection, item->tid, G_OBJECT (item->transaction));
 
+	/* the client only has a finite amount of time to use the object, else it's destroyed */
+	item->commit_id = g_timeout_add_seconds (PK_TRANSACTION_LIST_CREATE_COMMIT_TIMEOUT,
+					      (GSourceFunc) pk_transaction_list_no_commit_cb, item);
+
 	egg_debug ("adding transaction %p, item %p", item->transaction, item);
 	g_ptr_array_add (tlist->priv->array, item);
 	return TRUE;
@@ -414,9 +449,21 @@ pk_transaction_list_commit (PkTransactionList *tlist, const gchar *tid)
 		return FALSE;
 	}
 
+	/* check we're not this again */
+	if (item->committed) {
+		egg_warning ("already committed");
+		return FALSE;
+	}
+
 	egg_debug ("marking transaction %s as committed", item->tid);
 	item->committed = TRUE;
 
+	/* we've been 'used' */
+	if (item->commit_id != 0) {
+		g_source_remove (item->commit_id);
+		item->commit_id = 0;
+	}
+
 	/* we will changed what is running */
 	egg_debug ("emitting ::changed");
 	g_signal_emit (tlist, signals [PK_TRANSACTION_LIST_CHANGED], 0);
@@ -474,6 +521,28 @@ pk_transaction_list_get_size (PkTransactionList *tlist)
 }
 
 /**
+ * pk_transaction_list_print:
+ **/
+static void
+pk_transaction_list_print (PkTransactionList *tlist)
+{
+	guint i;
+	guint length;
+	PkRoleEnum role;
+	PkTransactionItem *item;
+
+	length = tlist->priv->array->len;
+	if (length == 0)
+		return;
+	for (i=0; i<length; i++) {
+		item = (PkTransactionItem *) g_ptr_array_index (tlist->priv->array, i);
+		role = pk_transaction_priv_get_role (item->transaction);
+		g_print ("%0i\t%s\trunning[%i] committed[%i] finished[%i]\n", i,
+			 pk_role_enum_to_text (role), item->running, item->committed, item->finished);
+	}
+}
+
+/**
  * pk_transaction_list_is_consistent:
  *
  * This checks the list for consistency so we don't ever deadlock the daemon
@@ -487,9 +556,9 @@ pk_transaction_list_is_consistent (PkTransactionList *tlist)
 	guint running = 0;
 	guint waiting = 0;
 	guint wrong = 0;
+	guint no_commit = 0;
 	guint length;
 	PkTransactionItem *item;
-	PkRoleEnum role;
 
 	g_return_val_if_fail (PK_IS_TRANSACTION_LIST (tlist), 0);
 
@@ -506,36 +575,37 @@ pk_transaction_list_is_consistent (PkTransactionList *tlist)
 			running++;
 		if (item->committed && !item->finished && !item->running)
 			waiting++;
+		if (!item->committed && !item->finished && !item->running)
+			no_commit++;
 		if (!item->committed && item->finished)
 			wrong++;
 		if (item->running && item->finished)
 			wrong++;
-
-		/* print */
-		role = pk_transaction_priv_get_role (item->transaction);
-		g_print ("%0i\t%s\trunning[%i] committed[%i] finished[%i]\n", i,
-			 pk_role_enum_to_text (role), item->running, item->committed, item->finished);
 	}
 
+	/* debug */
+	pk_transaction_list_print (tlist);
+
 	/* wrong flags */
 	if (wrong != 0) {
-		egg_warning ("inconsistent flags");
+		egg_warning ("%i have inconsistent flags", wrong);
 		ret = FALSE;
-		goto out;
 	}
 
+	/* some are not committed */
+	if (no_commit != 0)
+		egg_debug ("%i have not been committed", no_commit);
+
 	/* more than one running */
 	if (running > 1) {
-		egg_warning ("more than one running");
+		egg_warning ("%i are running", running);
 		ret = FALSE;
-		goto out;
 	}
 
 	/* nothing running */
 	if (waiting == length) {
 		egg_warning ("everything is waiting!");
 		ret = FALSE;
-		goto out;
 	}
 out:
 	return ret;
@@ -547,11 +617,7 @@ out:
 static gboolean
 pk_transaction_list_wedge_check2 (PkTransactionList *tlist)
 {
-	guint i;
-	guint length;
-	PkTransactionItem *item;
 	gboolean ret;
-	PkRoleEnum role;
 
 	g_return_val_if_fail (PK_IS_TRANSACTION_LIST (tlist), FALSE);
 
@@ -563,14 +629,8 @@ pk_transaction_list_wedge_check2 (PkTransactionList *tlist)
 	}
 
 	/* dump all the state we know */
-	egg_warning ("dumping flags:");
-	length = tlist->priv->array->len;
-	for (i=0; i<length; i++) {
-		item = (PkTransactionItem *) g_ptr_array_index (tlist->priv->array, i);
-		role = pk_transaction_priv_get_role (item->transaction);
-		g_print ("%0i\t%s\trunning[%i] committed[%i] finished[%i]\n", i,
-			 pk_role_enum_to_text (role), item->running, item->committed, item->finished);
-	}
+	egg_warning ("dumping data:");
+	pk_transaction_list_print (tlist);
 out:
 	/* never repeat */
 	return FALSE;
commit 54f1ab67583c5b5d1dfd02b96d7674cae048ef75
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 16:02:09 2008 +0100

    bugfix: if the refresh cache fails, don't do the PkRefresh actions

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index fdd976a..20b7c60 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -506,7 +506,8 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_update_detail);
 
 	/* do some optional extra actions when we've finished refreshing the cache */
-	if (transaction->priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
+	if (exit == PK_EXIT_ENUM_SUCCESS &&
+	    transaction->priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
 		PkRefresh *refresh;
 		refresh = pk_refresh_new ();
 
commit a2c3f7d388c76ed13ad36ef85e0c07283366fa88
Merge: ddce780... 17e5a8e...
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 13:49:46 2008 +0100

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

commit ddce7807fd7aa1d5e1d1041b559fa5e8f8c7bd58
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 13:49:34 2008 +0100

    trivial: eork around automake oddness

diff --git a/etc/.gitignore b/etc/.gitignore
index 3ccfb72..3475160 100644
--- a/etc/.gitignore
+++ b/etc/.gitignore
@@ -1,5 +1,4 @@
 Makefile
 Makefile.in
 PackageKit.conf
-Vendor.conf
 
diff --git a/etc/Makefile.am b/etc/Makefile.am
index ca11e27..352f802 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,17 +1,20 @@
 NULL =
 
 confdir = $(PK_CONF_DIR)
-conf_in_files = PackageKit.conf.in Vendor.conf.in
+conf_in_files = PackageKit.conf.in
 conf_DATA = $(conf_in_files:.conf.in=.conf)
 
 $(conf_DATA): $(conf_in_files) Makefile
 	@sed -e "s|\@defaultbackend\@|$(DEFAULT_BACKEND)|" $< > $@
 
+vendordir = $(PK_CONF_DIR)
+vendor_DATA = Vendor.conf
+
 EXTRA_DIST =						\
 	$(conf_in_files)				\
+	$(vendor_DATA)					\
 	$(NULL)
 
 DISTCLEANFILES =					\
-	Vendor.conf				\
 	PackageKit.conf
 
diff --git a/etc/Vendor.conf b/etc/Vendor.conf
new file mode 100644
index 0000000..ed1f5a9
--- /dev/null
+++ b/etc/Vendor.conf
@@ -0,0 +1,63 @@
+# Only the system vendor should modify this file, ordinary users
+# should not have to change anything.
+
+# Distributions should patch or replace this file when generating packages
+
+[PackagesNotFound]
+
+# This is a link to a vendor URL which is shown when a suitable package
+# could not be found in any remote software source.
+# The page set here should explain how to add new software sources if required.
+#
+# If the value is set to 'none' then no link is shown.
+#
+# default=http://www.packagekit.org/pk-package-not-found.html
+DefaultUrl=http://www.packagekit.org/pk-package-not-found.html
+
+# The URL which is shown to the user when a codec could not be found.
+# It should explain why certain codecs cannot be used, and perhaps show
+# links to web stores where the codec can be legally purchased.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+CodecUrl=none
+
+# The URL which is shown to the user when hardware drivers could not be found.
+# It should explain why some hardware is not supported, and links to futher
+# information.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+HardwareUrl=none
+
+# The URL which is shown to the user when fonts could not be found.
+# Alternatives should probably be suggested where possible.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+FontUrl=none
+
+# The URL which is shown to the user when programs handing a mime tpye could not
+# be found. It should probably explain how to use wine if the program is a
+# Windows program, or suggest alternatives.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+MimeUrl=none
+
+[Groups]
+
+# The vendor name shown for the 'vendor' group
+#
+# default=My Vendor
+VendorName=My Vendor
+
+# The vendor icon name shown for the 'vendor' group
+#
+# default=emblem-favorite
+VendorIcon=emblem-favorite
+
diff --git a/etc/Vendor.conf.in b/etc/Vendor.conf.in
deleted file mode 100644
index 80b9032..0000000
--- a/etc/Vendor.conf.in
+++ /dev/null
@@ -1,63 +0,0 @@
-# Only the system vendor should modify this file, ordinary users
-# should not have to change anything.
-
-# Distributions should patch or replace this file when generating packages
-
-[PackagesNotFound]
-
-# This is a link to a vendor URL which is shown when a suitable package
-# could not be found in any remote software source.
-# The page set here should explain how to add new software sources if required.
-#
-# If the value is set to 'none' then no link is shown.
-#
-# default=http://www.packagekit.org/pk-package-not-found.html
-DefaultUrl=http://www.packagekit.org/pk-package-not-found.html
-
-# The URL which is shown to the user when a codec could not be found.
-# It should explain why certain codecs cannot be used, and perhaps show
-# links to web stores where the codec can be legally purchased.
-#
-# If the value is set to 'none' then the value of DefaultUrl is used.
-#
-# default=none
-CodecUrl=none
-
-# The URL which is shown to the user when hardware drivers could not be found.
-# It should explain why some hardware is not supported, and links to futher
-# information.
-#
-# If the value is set to 'none' then the value of DefaultUrl is used.
-#
-# default=none
-HardwareUrl=none
-
-# The URL which is shown to the user when fonts could not be found.
-# Alternatives should probably be suggested where possible.
-#
-# If the value is set to 'none' then the value of DefaultUrl is used.
-#
-# default=none
-FontsUrl=none
-
-# The URL which is shown to the user when programs handing a mime tpye could not
-# be found. It should probably explain how to use wine if the program is a
-# Windows program, or suggest alternatives.
-#
-# If the value is set to 'none' then the value of DefaultUrl is used.
-#
-# default=none
-MimeUrl=none
-
-[Groups]
-
-# The vendor name shown for the 'vendor' group
-#
-# default=My Vendor
-VendorName=My Vendor
-
-# The vendor icon name shown for the 'vendor' group
-#
-# default=emblem-favorite
-VendorIcon=emblem-favorite
-
commit 17e5a8e6f19fbbb4df2138918522db74471d52d7
Author: Thomas Spura <spurath at students.uni-mainz.de>
Date:   Fri Oct 3 12:22:47 2008 +0000

    Updated German Translation
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/de.po b/po/de.po
index 3d715ac..17bdeea 100644
--- a/po/de.po
+++ b/po/de.po
@@ -16,7 +16,7 @@ msgstr ""
 "Project-Id-Version: policycoreutils.HEAD.de\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2008-09-25 00:31+0000\n"
-"PO-Revision-Date: 2008-09-30 00:44+0200\n"
+"PO-Revision-Date: 2008-10-03 14:17+0200\n"
 "Last-Translator: Fabian Affolter <fab at fedoraproject.org>\n"
 "Language-Team:  <en at li.org>\n"
 "MIME-Version: 1.0\n"
@@ -26,7 +26,7 @@ msgstr ""
 
 #: ../client/pk-console.c:274
 msgid "Update detail"
-msgstr ""
+msgstr "Details werden aktualisiert"
 
 #: ../client/pk-console.c:491
 msgid "A system restart is required"
@@ -42,7 +42,7 @@ msgstr "Ein Programm-Neustart wird benötigt"
 
 #: ../client/pk-console.c:588 ../client/pk-generate-pack.c:126
 msgid "There are multiple package matches"
-msgstr ""
+msgstr "Es passen mehrere Packete"
 
 #. find out what package the user wants to use
 #: ../client/pk-console.c:595 ../client/pk-generate-pack.c:133
@@ -55,16 +55,16 @@ msgstr ""
 
 #: ../client/pk-console.c:735
 msgid "Could not find package to remove"
-msgstr ""
+msgstr "Die Packete zum Löschen konnten nicht gefunden werden"
 
 #: ../client/pk-console.c:796
 msgid "The following packages have to be removed"
-msgstr ""
+msgstr "Die folgenden Packete müssen entfernt werden"
 
 #. get user input
 #: ../client/pk-console.c:803
 msgid "Okay to remove additional packages?"
-msgstr ""
+msgstr "Dürfen die zusätzlichen Packete entfernt werden?"
 
 #: ../client/pk-console.c:807 ../client/pk-generate-pack.c:528
 #: ../client/pk-generate-pack-main.c:131
@@ -92,19 +92,17 @@ msgid "Could not find details for"
 msgstr "Konnte keine Details finden für"
 
 #: ../client/pk-console.c:980
-#, fuzzy
 msgid "Could not find the files for this package"
-msgstr "Konnte Datei-Kontexte nicht auflisten"
+msgstr "Die Dateien für dieses Packet konnte nicht gefunden werden"
 
 #: ../client/pk-console.c:987
 #, fuzzy
 msgid "Could not get the file list"
-msgstr "Konnte Datei-Kontexte nicht auflisten"
+msgstr "Die Dateiliste konnte nicht geholt werden"
 
 #: ../client/pk-console.c:1006
-#, fuzzy
 msgid "Could not find the update details for"
-msgstr "Konnte Schlüssel für %s nicht kreieren"
+msgstr "Die Aktualisierungsdetails konnten nicht gefunden werden für"
 
 #: ../client/pk-console.c:1067
 msgid "Package description"
@@ -112,7 +110,7 @@ msgstr "Packet-Beschreibung"
 
 #: ../client/pk-console.c:1100
 msgid "Package files"
-msgstr ""
+msgstr "Packet-Dateien"
 
 #: ../client/pk-console.c:1108
 msgid "No files"
@@ -121,7 +119,7 @@ msgstr "Keine Dateien"
 #. get user input
 #: ../client/pk-console.c:1140
 msgid "Okay to import key?"
-msgstr ""
+msgstr "Darf der Schlüssel importiert werden?"
 
 #: ../client/pk-console.c:1143
 msgid "Did not import key"
@@ -164,12 +162,11 @@ msgstr "Setze den Filter, z.B. installiert"
 
 #: ../client/pk-console.c:1384
 msgid "Exit without waiting for actions to complete"
-msgstr ""
+msgstr "Beende ohne auf fertigzustellende Aktionen zu warten"
 
 #: ../client/pk-console.c:1407
-#, fuzzy
 msgid "Could not connect to system DBUS."
-msgstr "Konnte exec-Kontext nicht auf %s setzen.\n"
+msgstr "Konnte nicht mit dem System-DBUS verbinden."
 
 #: ../client/pk-console.c:1500
 msgid "You need to specify a search type, e.g. name"
@@ -298,7 +295,7 @@ msgstr ""
 
 #: ../client/pk-generate-pack-main.c:129
 msgid "A pack with the same name already exists, do you want to overwrite it?"
-msgstr ""
+msgstr "Ein Packet mit dem selben Namen existiert bereits, möchten Sie es überschreiben?"
 
 #: ../client/pk-generate-pack-main.c:142
 #, fuzzy
@@ -322,7 +319,7 @@ msgstr "Konnte Datei %s nicht öffnen\n"
 
 #: ../client/pk-import-specspo.c:193
 msgid "You probably need to run this program as the root user"
-msgstr ""
+msgstr "Sie müssen dieses Programm vermutlich als root starten"
 
 #: ../client/pk-monitor.c:131
 msgid "PackageKit Monitor"
@@ -335,7 +332,7 @@ msgstr "Ports müssen zahlen zwischen 1 und %d sein"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:300
 msgid "Getting package information..."
-msgstr ""
+msgstr "Packet-Informationen werden geholt"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:304
 #, c-format
@@ -365,6 +362,8 @@ msgid ""
 "\n"
 "<span color='#%06x' underline='single'>Run version %s now</span>"
 msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Version %s wird jetzt ausgeführt</span>"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:321
 #, c-format
@@ -372,6 +371,8 @@ msgid ""
 "\n"
 "<span color='#%06x' underline='single'>Run now</span>"
 msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Wird jetzt ausgeführt</span>"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:325
 #, c-format
@@ -379,12 +380,15 @@ msgid ""
 "\n"
 "<span color='#%06x' underline='single'>Upgrade to version %s</span>"
 msgstr ""
+"\n"
+"<span color='#%06x' underline='single'>Aktualisierung zu Version %s</span>"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:330
 #, c-format
 msgid ""
 "<span color='#%06x' underline='single' size='larger'>Install %s Now</span>"
 msgstr ""
+"<span color='#%06x' underline='single' size='larger'>%s wird jetzt installiert</span>"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:333
 #, c-format
@@ -400,6 +404,8 @@ msgid ""
 "\n"
 "<small>No packages found for your system</small>"
 msgstr ""
+"\n"
+"<small>Es wurden keine Packete für Ihr System gefunden</small>"
 
 #: ../contrib/packagekit-plugin/src/contents.cpp:341
 msgid ""
@@ -411,7 +417,7 @@ msgstr ""
 
 #: ../data/packagekit-catalog.xml.in.h:1
 msgid "PackageKit Catalog"
-msgstr ""
+msgstr "PackageKit Katalog"
 
 #: ../data/packagekit-pack.xml.in.h:1
 msgid "PackageKit Service Pack"
@@ -433,7 +439,7 @@ msgstr ""
 msgid ""
 "The org.freedesktop.PackageKit.conf file is not installed in the system /etc/"
 "dbus-1/system.d directory"
-msgstr ""
+msgstr "Die org.freedesktop.PackageKit.conf-Datei ist nicht auf Ihrem Rechner in /etc/dbus-1/system.d installiert"
 
 #: ../src/pk-main.c:188
 msgid "Packaging backend to use, e.g. dummy"
commit 7c9ed423599d36652264b288786242f68f4c4a99
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 12:24:36 2008 +0100

    trivial: new group enum: vendor

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index ba427ed..10c153b 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -256,6 +256,7 @@ static const PkEnumMatch enum_group[] = {
 	{PK_GROUP_ENUM_DOCUMENTATION,		"documentation"},
 	{PK_GROUP_ENUM_ELECTRONICS,		"electronics"},
 	{PK_GROUP_ENUM_COLLECTIONS,		"collections"},
+	{PK_GROUP_ENUM_VENDOR,			"vendor"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 4ad8570..6a3bcb2 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -314,6 +314,7 @@ typedef enum {
 	PK_GROUP_ENUM_DOCUMENTATION,
 	PK_GROUP_ENUM_ELECTRONICS,
 	PK_GROUP_ENUM_COLLECTIONS,
+	PK_GROUP_ENUM_VENDOR,
 	PK_GROUP_ENUM_UNKNOWN
 } PkGroupEnum;
 
commit b8399e7320caa52b22a4fac8df926b77a83a3a1d
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 12:19:21 2008 +0100

    feature: add a way for a big company to change the name of the vendor group

diff --git a/etc/Vendor.conf.in b/etc/Vendor.conf.in
index f65f589..80b9032 100644
--- a/etc/Vendor.conf.in
+++ b/etc/Vendor.conf.in
@@ -49,3 +49,15 @@ FontsUrl=none
 # default=none
 MimeUrl=none
 
+[Groups]
+
+# The vendor name shown for the 'vendor' group
+#
+# default=My Vendor
+VendorName=My Vendor
+
+# The vendor icon name shown for the 'vendor' group
+#
+# default=emblem-favorite
+VendorIcon=emblem-favorite
+
commit bafd40b537c11cc7dbf4753f50184c1c77fd50bd
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Oct 3 12:18:11 2008 +0100

    feature: add a file Vendor.conf that allows vendors to change the URLs used in the frontend programs

diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 07c3d9f..4351fc3 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -209,7 +209,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
 %{python_sitelib}/packagekit/*py*
 %dir %{_sysconfdir}/bash_completion.d
 %config %{_sysconfdir}/bash_completion.d/pk-completion.bash
-%config(noreplace) %{_sysconfdir}/PackageKit/PackageKit.conf
+%config(noreplace) %{_sysconfdir}/PackageKit/*.conf
 %config %{_sysconfdir}/dbus-1/system.d/*
 %dir %{_datadir}/PackageKit/helpers/test_spawn
 %{_datadir}/PackageKit/helpers/test_spawn/*
diff --git a/docs/html/Makefile.am b/docs/html/Makefile.am
index 2047201..59d2760 100644
--- a/docs/html/Makefile.am
+++ b/docs/html/Makefile.am
@@ -12,6 +12,7 @@ HTML_FILES =				\
 	pk-profiles.html		\
 	pk-reference.html		\
 	pk-screenshots.html		\
+	pk-package-not-found.html	\
 	pk-using.html
 
 EXTRA_DIST = 				\
diff --git a/docs/html/pk-package-not-found.html b/docs/html/pk-package-not-found.html
new file mode 100644
index 0000000..8ae23c5
--- /dev/null
+++ b/docs/html/pk-package-not-found.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Package Not Found</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
+</head>
+<body>
+
+<h1>Package Not Found</h1>
+
+<p>
+ This is the default page used to direct users to a distribution specific resource.
+</p>
+<p>
+ If you are seeing this page, you need to file a bug in your distributions bugtracker, and get
+ them to change the value of <code>PackageNotFoundUrl</code> in <code>/etc/PackageKit/Vendor.conf</code>.
+</p>
+
+</body>
+</html>
diff --git a/etc/.gitignore b/etc/.gitignore
index 3475160..3ccfb72 100644
--- a/etc/.gitignore
+++ b/etc/.gitignore
@@ -1,4 +1,5 @@
 Makefile
 Makefile.in
 PackageKit.conf
+Vendor.conf
 
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 7a6d86d..ca11e27 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,7 +1,7 @@
 NULL =
 
 confdir = $(PK_CONF_DIR)
-conf_in_files = PackageKit.conf.in
+conf_in_files = PackageKit.conf.in Vendor.conf.in
 conf_DATA = $(conf_in_files:.conf.in=.conf)
 
 $(conf_DATA): $(conf_in_files) Makefile
@@ -12,5 +12,6 @@ EXTRA_DIST =						\
 	$(NULL)
 
 DISTCLEANFILES =					\
+	Vendor.conf				\
 	PackageKit.conf
 
diff --git a/etc/Vendor.conf.in b/etc/Vendor.conf.in
new file mode 100644
index 0000000..f65f589
--- /dev/null
+++ b/etc/Vendor.conf.in
@@ -0,0 +1,51 @@
+# Only the system vendor should modify this file, ordinary users
+# should not have to change anything.
+
+# Distributions should patch or replace this file when generating packages
+
+[PackagesNotFound]
+
+# This is a link to a vendor URL which is shown when a suitable package
+# could not be found in any remote software source.
+# The page set here should explain how to add new software sources if required.
+#
+# If the value is set to 'none' then no link is shown.
+#
+# default=http://www.packagekit.org/pk-package-not-found.html
+DefaultUrl=http://www.packagekit.org/pk-package-not-found.html
+
+# The URL which is shown to the user when a codec could not be found.
+# It should explain why certain codecs cannot be used, and perhaps show
+# links to web stores where the codec can be legally purchased.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+CodecUrl=none
+
+# The URL which is shown to the user when hardware drivers could not be found.
+# It should explain why some hardware is not supported, and links to futher
+# information.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+HardwareUrl=none
+
+# The URL which is shown to the user when fonts could not be found.
+# Alternatives should probably be suggested where possible.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+FontsUrl=none
+
+# The URL which is shown to the user when programs handing a mime tpye could not
+# be found. It should probably explain how to use wine if the program is a
+# Windows program, or suggest alternatives.
+#
+# If the value is set to 'none' then the value of DefaultUrl is used.
+#
+# default=none
+MimeUrl=none
+
commit 8223053aff2c635e69bc9b54ad226e74518d7123
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 11:19:42 2008 +0100

    bugfix: instead of waiting in pk_spawn_exit, block so that we can't try to execute other scripts while it's exiting

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index 9413cad..733bbef 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -70,7 +70,6 @@ struct PkSpawnPrivate
 	gboolean		 is_sending_exit;
 	gboolean		 is_changing_dispatcher;
 	PkSpawnExitType		 exit;
-	GMainLoop		*exit_loop;
 	GString			*stdout_buf;
 	gchar			*last_argv0;
 	gchar			**last_envp;
@@ -150,7 +149,6 @@ static gboolean
 pk_spawn_check_child (PkSpawn *spawn)
 {
 	int status;
-	gboolean ret;
 	static guint limit_printing = 0;
 
 	/* this shouldn't happen */
@@ -201,17 +199,11 @@ pk_spawn_check_child (PkSpawn *spawn)
 		spawn->priv->kill_id = 0;
 	}
 
-	/* are we waiting for a "exit" from the dispatcher? */
-	ret = g_main_loop_is_running (spawn->priv->exit_loop);
-	if (ret) {
-		g_main_loop_quit (spawn->priv->exit_loop);
-
-		/* are we doing pk_spawn_exit for a good reason? */
-		if (spawn->priv->is_changing_dispatcher)
-			spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED;
-		else if (spawn->priv->is_sending_exit)
-			spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT;
-	}
+	/* are we doing pk_spawn_exit for a good reason? */
+	if (spawn->priv->is_changing_dispatcher)
+		spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED;
+	else if (spawn->priv->is_sending_exit)
+		spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT;
 
 	/* don't emit if we just closed an invalid dispatcher */
 	egg_debug ("emitting exit %i", spawn->priv->exit);
@@ -340,6 +332,7 @@ gboolean
 pk_spawn_exit (PkSpawn *spawn)
 {
 	gboolean ret;
+	guint count = 0;
 
 	g_return_val_if_fail (PK_IS_SPAWN (spawn), FALSE);
 
@@ -352,13 +345,23 @@ pk_spawn_exit (PkSpawn *spawn)
 	/* send command */
 	spawn->priv->is_sending_exit = TRUE;
 	ret = pk_spawn_send_stdin (spawn, "exit");
+	if (!ret)
+		goto out;
 
-	/* wait for the script to exit */
-	if (ret) {
-		g_main_loop_run (spawn->priv->exit_loop);
-		egg_debug ("instance exited");
-	}
-
+	/* block until the previous script exited */
+	do {
+		egg_debug ("waiting for exit");
+		/* Usleep rather than g_main_loop_run -- we have to block.
+		 * If we run the loop, other idle events can be processed,
+		 * and this includes sending data to a new instance,
+		 * which of course will fail as the 'old' script is exiting */
+		g_usleep (100*1000); /* 100 ms */
+		ret = pk_spawn_check_child (spawn);
+	} while (ret && count++ < 50);
+
+	/* the script exited okay */
+	ret = TRUE;
+out:
 	spawn->priv->is_sending_exit = FALSE;
 	return ret;
 }
@@ -522,7 +525,6 @@ pk_spawn_init (PkSpawn *spawn)
 	spawn->priv->exit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 
 	spawn->priv->stdout_buf = g_string_new ("");
-	spawn->priv->exit_loop = g_main_loop_new (NULL, FALSE);
 	spawn->priv->conf = pk_conf_new ();
 }
 
@@ -558,7 +560,6 @@ pk_spawn_finalize (GObject *object)
 	g_string_free (spawn->priv->stdout_buf, TRUE);
 	g_free (spawn->priv->last_argv0);
 	g_strfreev (spawn->priv->last_envp);
-	g_main_loop_unref (spawn->priv->exit_loop);
 	g_object_unref (spawn->priv->conf);
 
 	G_OBJECT_CLASS (pk_spawn_parent_class)->finalize (object);
commit f932d8d616d02c67a01e49f52b667314c03ba5e6
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 11:14:48 2008 +0100

    trivial: add some debugging into the daemon output

diff --git a/src/pk-transaction-list.c b/src/pk-transaction-list.c
index 9470da9..bc8fd35 100644
--- a/src/pk-transaction-list.c
+++ b/src/pk-transaction-list.c
@@ -197,7 +197,7 @@ pk_transaction_list_remove (PkTransactionList *tlist, const gchar *tid)
 		return FALSE;
 	}
 	if (item->finished) {
-		egg_warning ("already finished, so waiting to timeout");
+		egg_debug ("already finished, so waiting to timeout");
 		return FALSE;
 	}
 	/* check if we are running, or _just_ about to be run */
@@ -489,6 +489,7 @@ pk_transaction_list_is_consistent (PkTransactionList *tlist)
 	guint wrong = 0;
 	guint length;
 	PkTransactionItem *item;
+	PkRoleEnum role;
 
 	g_return_val_if_fail (PK_IS_TRANSACTION_LIST (tlist), 0);
 
@@ -498,7 +499,7 @@ pk_transaction_list_is_consistent (PkTransactionList *tlist)
 		goto out;
 
 	/* get state */
-	egg_debug ("checking consistency");
+	egg_debug ("checking consistency as length %i", length);
 	for (i=0; i<length; i++) {
 		item = (PkTransactionItem *) g_ptr_array_index (tlist->priv->array, i);
 		if (item->running)
@@ -509,6 +510,11 @@ pk_transaction_list_is_consistent (PkTransactionList *tlist)
 			wrong++;
 		if (item->running && item->finished)
 			wrong++;
+
+		/* print */
+		role = pk_transaction_priv_get_role (item->transaction);
+		g_print ("%0i\t%s\trunning[%i] committed[%i] finished[%i]\n", i,
+			 pk_role_enum_to_text (role), item->running, item->committed, item->finished);
 	}
 
 	/* wrong flags */
commit 85b1d49470152712e19aa69f04ee7edbdd0a2ae7
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 11:13:36 2008 +0100

    trivial: spend less time unlocking to speed up test suite

diff --git a/data/tests/pk-spawn-dispatcher.py b/data/tests/pk-spawn-dispatcher.py
index f96d960..e34cbe6 100755
--- a/data/tests/pk-spawn-dispatcher.py
+++ b/data/tests/pk-spawn-dispatcher.py
@@ -28,7 +28,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
     def unLock(self):
         PackageKitBaseBackend.unLock(self)
         # simulate doing something
-        time.sleep(1)
+        time.sleep(0.5)
 
     def search_name(self,filters,key):
         # check we escape spaces properly
commit 452acc5778546070055a53e1b19f09c0a278c2bf
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 10:39:05 2008 +0100

    trivial: use unknown, rather then the random 999 as a self check code

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index fe440ea..9413cad 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -582,9 +582,8 @@ pk_spawn_new (void)
  ***************************************************************************/
 #ifdef EGG_TEST
 #include "egg-test.h"
-#define BAD_EXIT 999
 
-PkSpawnExitType mexit = BAD_EXIT;
+PkSpawnExitType mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 guint stdout_count = 0;
 guint finished_count = 0;
 
@@ -667,7 +666,7 @@ pk_spawn_test (EggTest *test)
 	 **********           Generic tests               ***********
 	 ************************************************************/
 	egg_test_title (test, "make sure return error for missing file");
-	mexit = BAD_EXIT;
+	mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 	argv = g_strsplit ("pk-spawn-test-xxx.sh", " ", 0);
 	ret = pk_spawn_argv (spawn, argv, NULL);
 	g_strfreev (argv);
@@ -678,7 +677,7 @@ pk_spawn_test (EggTest *test)
 
 	/************************************************************/
 	egg_test_title (test, "make sure finished wasn't called");
-	if (mexit == BAD_EXIT)
+	if (mexit == PK_SPAWN_EXIT_TYPE_UNKNOWN)
 		egg_test_success (test, NULL);
 	else
 		egg_test_failed (test, "Called finish for bad file!");
@@ -753,7 +752,7 @@ pk_spawn_test (EggTest *test)
 	 **********           Killing tests               ***********
 	 ************************************************************/
 	egg_test_title (test, "make sure run correct helper, and kill it");
-	mexit = BAD_EXIT;
+	mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 	path = egg_test_get_data_file ("pk-spawn-test.sh");
 	argv = g_strsplit (path, " ", 0);
 	ret = pk_spawn_argv (spawn, argv, NULL);
@@ -781,7 +780,7 @@ pk_spawn_test (EggTest *test)
 
 	/************************************************************/
 	egg_test_title (test, "make sure run correct helper, and quit it");
-	mexit = BAD_EXIT;
+	mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 	path = egg_test_get_data_file ("pk-spawn-test-sigquit.sh");
 	argv = g_strsplit (path, " ", 0);
 	ret = pk_spawn_argv (spawn, argv, NULL);
@@ -823,7 +822,7 @@ pk_spawn_test (EggTest *test)
 	 **********  Can we send commands to a dispatcher ***********
 	 ************************************************************/
 	egg_test_title (test, "run the dispatcher");
-	mexit = BAD_EXIT;
+	mexit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
 	file = egg_test_get_data_file ("pk-spawn-dispatcher.py");
 	path = g_strdup_printf ("%s\tsearch-name\tnone\tpower manager", file);
 	argv = g_strsplit (path, "\t", 0);
commit a8d6cd6f7beccc01d53898bef9de4e90eb2147b7
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 10:36:53 2008 +0100

    trivial: add a unit test to test for re-entrancy in pk-spawn, which we fail miserably

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index 55f847e..fe440ea 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -631,6 +631,21 @@ new_spawn_object (EggTest *test, PkSpawn **pspawn)
 	stdout_count = 0;
 }
 
+static gboolean
+idle_cb (gpointer data)
+{
+	EggTest *test = (EggTest*) data;
+
+	egg_test_title (test, "make sure dispatcher has closed when run idle add");
+	if (mexit == PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT)
+		egg_test_success (test, NULL);
+	else
+		egg_test_failed (test, "mexit was %i", mexit);
+
+	/* never repeat */
+	return FALSE;
+}
+
 void
 pk_spawn_test (EggTest *test)
 {
@@ -862,6 +877,9 @@ pk_spawn_test (EggTest *test)
 	else
 		egg_test_failed (test, "did not get a package");
 
+	/* see if pk_spawn_exit blocks (required) */
+	g_idle_add (idle_cb, test);
+
 	/************************************************************/
 	egg_test_title (test, "ask dispatcher to close");
 	ret = pk_spawn_exit (spawn);
commit b247a1787f8dc2c217be6c902c2872988e6a7a98
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 10:28:34 2008 +0100

    trivial: make the test dispatcher more realistic by adding delays in __init__ and unLock

diff --git a/data/tests/pk-spawn-dispatcher.py b/data/tests/pk-spawn-dispatcher.py
index 419f571..f96d960 100755
--- a/data/tests/pk-spawn-dispatcher.py
+++ b/data/tests/pk-spawn-dispatcher.py
@@ -15,11 +15,20 @@
 # Dispacher script to run pk commands from stdin
 
 import sys
+import time
 from packagekit.backend import *
 
 class PackageKitYumBackend(PackageKitBaseBackend):
     def __init__(self,args,lock=True):
         PackageKitBaseBackend.__init__(self,args)
+        PackageKitBaseBackend.doLock(self)
+        # simulate doing something
+        time.sleep(2)
+
+    def unLock(self):
+        PackageKitBaseBackend.unLock(self)
+        # simulate doing something
+        time.sleep(1)
 
     def search_name(self,filters,key):
         # check we escape spaces properly
diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index 0f912f7..55f847e 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -821,11 +821,11 @@ pk_spawn_test (EggTest *test)
 		egg_test_failed (test, "did not run dispatcher");
 
 	/************************************************************/
-	egg_test_title (test, "wait 2 seconds for the dispatcher");
+	egg_test_title (test, "wait 2+2 seconds for the dispatcher");
 	/* wait 2 seconds, and make sure we are still running */
-	egg_test_loop_wait (test, 2000);
+	egg_test_loop_wait (test, 4000);
 	elapsed = egg_test_elapsed (test);
-	if (elapsed > 1900 && elapsed < 2100)
+	if (elapsed > 3900 && elapsed < 4100)
 		egg_test_success (test, NULL);
 	else
 		egg_test_failed (test, "dispatcher exited");
commit 276d3634e9272a9754fda817fc8799fcfe6e8060
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 10:25:26 2008 +0100

    bugfix: when we exit the dispatcher with 'exit' ensure we unlock if locked

diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index cfe906c..3339fec 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -590,6 +590,11 @@ class PackageKitBaseBackend:
             args = line.split('\t')
             self.dispatch_command(args[0], args[1:])
 
+        # unlock backend and exit with success
+        if self.isLocked():
+            self.unLock()
+        sys.exit(0)
+
 def exceptionHandler(typ, value, tb, base):
     # Restore original exception handler
     sys.excepthook = sys.__excepthook__
commit 587b3dd5453a831c5bbdf46dacaeeabd676d6997
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Fri Oct 3 10:23:41 2008 +0100

    bugfix: unlock the backend before we send finished on ErrorCode as unlocking may take some time

diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index c12b163..cfe906c 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -79,12 +79,15 @@ class PackageKitBaseBackend:
         @param description: Error description
         @param exit: exit application with rc = 1, if true
         '''
+        # unlock before we emit if we are going to exit
+        if exit and self.isLocked():
+            self.unLock()
+
+        # this should be fast now
         print "error\t%s\t%s" % (err, description)
         print "finished"
         sys.stdout.flush()
         if exit:
-            if self.isLocked():
-                self.unLock()
             sys.exit(1)
 
     def message(self, typ, msg):
commit ef8007f20e973f8b836d8c5746941dc8fd22366e
Merge: ded68ec... 7ab9fdd...
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Thu Oct 2 21:04:51 2008 +0100

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

commit ded68ec70cbfa06c48c114e6a8727cf584eb8791
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Thu Oct 2 21:04:29 2008 +0100

    trivial: warn if we try to respawn when trying to kill the daemon

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index fa14d0e..0f912f7 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -390,6 +390,12 @@ pk_spawn_argv (PkSpawn *spawn, gchar **argv, gchar **envp)
 			egg_debug ("envp[%i] '%s'", i, envp[i]);
 	}
 
+	/* check we are not using a closing instance */
+	if (spawn->priv->is_sending_exit) {
+		egg_warning ("trying to use instance that is in the process of exiting");
+		return FALSE;
+	}
+
 	/* we can reuse the dispatcher if:
 	 *  - it's still running
 	 *  - argv[0] (executable name is the same)
commit 7ab9fdd57cbfff2aec27d72f60bf4d8aab834342
Merge: a00f008... cb10b4a...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Thu Oct 2 17:27:03 2008 +0200

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

commit cb10b4af4e4f11d5eb522118d03b0539b954a211
Merge: 91d6f12... 6b632fc...
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Oct 2 17:32:56 2008 +0200

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

commit a00f00888051ba2603f19014889426aeeda6c572
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Thu Oct 2 17:23:41 2008 +0200

    trivial: add placeholder for arch groups

diff --git a/backends/smart/smartBackend.py b/backends/smart/smartBackend.py
index 81985dc..ff18d78 100755
--- a/backends/smart/smartBackend.py
+++ b/backends/smart/smartBackend.py
@@ -694,7 +694,9 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
     # APT
     "metapackages"                            : GROUP_COLLECTIONS,
     # Slack
-    "Slackware"                               : GROUP_UNKNOWN
+    "Slackware"                               : GROUP_UNKNOWN,
+    # Arch
+    "Archlinux"                               : GROUP_UNKNOWN
     }
     
     @needs_cache
commit 6b632fc95e9a13eca5075416ae8c6942081bcd73
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Thu Oct 2 17:09:59 2008 +0200

    smart: restore the backend.reset() that got lost in refactoring

diff --git a/backends/smart/smartBackend.py b/backends/smart/smartBackend.py
index a50c6f9..81985dc 100755
--- a/backends/smart/smartBackend.py
+++ b/backends/smart/smartBackend.py
@@ -45,6 +45,7 @@ def needs_cache(func):
             obj.ctrl.reloadChannels()
         result = None
         try:
+            obj.reset()
             result = func(obj, *args, **kwargs)
         except UnicodeDecodeError, e:
             pass
commit 91d6f12ff2086c87f4742c1b7133a303baea487f
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Oct 2 16:33:09 2008 +0200

    APT: add a note about implementing the codec search using debtags (will
    be used by Debian)

diff --git a/backends/apt/TODO b/backends/apt/TODO
index ffb4f60..affc71b 100644
--- a/backends/apt/TODO
+++ b/backends/apt/TODO
@@ -22,3 +22,6 @@ TODO:
    search name (do we want this?)
 
  * Test and think about packages from cdroms
+
+ * Talk to Sebastian Dröge about his new codec search implementation using
+   debtags
commit 916630921212f013add166f245d0f5152952c1fa
Author: Sebastian Heinlein <devel at glatzor.de>
Date:   Thu Oct 2 16:29:20 2008 +0200

    APT: Instead of using the raw codec string in WhatProvides use the one
    produced by the gstreamer packagekit plugin

diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index d8b953e..8e4b4b3 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1550,35 +1550,29 @@ class PackageKitAptBackend(PackageKitBaseBackend):
         self.AllowCancel(False)
         if provides_type == PROVIDES_CODEC:
             # The search term from the codec helper looks like this one:
-            # "gstreamer.net|0.10|totem|DivX MPEG-4 Version 5 decoder|" \
-            # "decoder-video/x-divx, divxversion=(int)5 (DivX MPEG-4 Version " \
-            # "5 decoder)"
-            try:
-                (origin, version, app, descr, term) = search.split("|")
-            except ValueError, e:
+            match = re.match(r"gstreamer(.+)\((.+)\)\((.+)\)", search)
+            if not match:
                 self.ErrorCode(ERROR_UNKNOWN,
                                "The search term is invalid")
                 self.Finished(EXIT_FAILED)
                 return
+            codec = "%s:%s" % (match.group(1), match.group(2))
             db = get_mapping_db("/var/cache/app-install/gai-codec-map.gdbm")
             if db == None:
+                self.ErrorCode(ERROR_INTERNAL_ERROR,
+                               "Failed to open codec mapping database")
                 self.Finished(EXIT_FAILED)
                 return
-            handlers = set()
-            for k in db.keys():
-                codec = k
-                if ":" in codec:
-                    codec = codec.split(":")[1]
-                if codec in term:
-                    # The codec mapping db stores the packages as a string
-                    # separated by spaces. Each package has its section
-                    # prefixed and separated by a slash
-                    # FIXME: Should make use of the section and emit a 
-                    #        RepositoryRequired signal if the package does 
-                    #        not exist
-                    handlers.update(set(map(lambda s: s.split("/")[1],
-                                        db[k].split(" "))))
-            self._emit_visible_packages_by_name(filters, handlers)
+            if db.has_key(codec):
+                # The codec mapping db stores the packages as a string
+                # separated by spaces. Each package has its section
+                # prefixed and separated by a slash
+                # FIXME: Should make use of the section and emit a 
+                #        RepositoryRequired signal if the package does 
+                #        not exist
+                pkgs = map(lambda s: s.split("/")[1],
+                           db[codec].split(" "))
+                self._emit_visible_packages_by_name(filters, pkgs)
         elif provides_type == PROVIDES_MIMETYPE:
             # Emit packages that contain an application that can handle
             # the given mime type
commit fdb756d3f862fa4d31af9638682d7b5f01785855
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Thu Oct 2 15:59:27 2008 +0200

    smart: implement GetMimeTypes

diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index d443816..8d61b39 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -111,6 +111,20 @@ backend_get_filters (PkBackend *backend)
 }
 
 /**
+ * pk_backend_get_mime_types:
+ */
+static gchar *
+backend_get_mime_types (PkBackend *backend)
+{
+	return g_strdup ("application/x-rpm;"
+	                 "application/x-deb;"
+	                 "application/x-gzip;"	/* .tgz */
+	                 "application/x-bzip2;"	/* .tbz */
+	                 "application/x-lzma;"	/* .tlz */
+	                 "application/x-arch-pkg");
+}
+
+/**
  * pk_backend_bool_to_text:
  */
 static const gchar *
@@ -450,7 +464,7 @@ PK_BACKEND_OPTIONS (
 	backend_destroy,				/* destroy */
 	backend_get_groups,				/* get_groups */
 	backend_get_filters,				/* get_filters */
-	NULL,						/* get_mime_types */
+	backend_get_mime_types,				/* get_mime_types */
 	backend_cancel,					/* cancel */
 	backend_download_packages,			/* download_packages */
 	backend_get_depends,				/* get_depends */
commit 669a6e9413e382cfd8ccd65af6d0cc2749a576dc
Merge: 2f45068... fadce83...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Thu Oct 2 15:41:49 2008 +0200

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

commit fadce83f5d5d21a0707e53d86f447ae4a85678b8
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Thu Oct 2 13:18:15 2008 +0100

    bugfix: fix a theoretical hang where we could try to reuse a exiting instance
    
    As pk_spawn_exit() was blocked in pk_spawn_argv(), a new process could not be spawned when
    the instance was shutting down. This was not the case when pk_spawn_exit() was called from
    PkBackendSpawn, and so if the backend was in the process of exiting and a new command was
    send to the dispatcher, the daemon would stop processing existing requests.
    The fix is quite simple, forcing pk_spawn_exit() to wait for completion in all cases,
    and then to add an extra flag to differentiate between a forced exit and the changing of
    the dispatcher

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index e7c4db7..fa14d0e 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -68,6 +68,7 @@ struct PkSpawnPrivate
 	guint			 kill_id;
 	gboolean		 finished;
 	gboolean		 is_sending_exit;
+	gboolean		 is_changing_dispatcher;
 	PkSpawnExitType		 exit;
 	GMainLoop		*exit_loop;
 	GString			*stdout_buf;
@@ -204,12 +205,13 @@ pk_spawn_check_child (PkSpawn *spawn)
 	ret = g_main_loop_is_running (spawn->priv->exit_loop);
 	if (ret) {
 		g_main_loop_quit (spawn->priv->exit_loop);
-		spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED;
-	}
 
-	/* are we doing pk_spawn_exit */
-	if (spawn->priv->is_sending_exit)
-		spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT;
+		/* are we doing pk_spawn_exit for a good reason? */
+		if (spawn->priv->is_changing_dispatcher)
+			spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_CHANGED;
+		else if (spawn->priv->is_sending_exit)
+			spawn->priv->exit = PK_SPAWN_EXIT_TYPE_DISPATCHER_EXIT;
+	}
 
 	/* don't emit if we just closed an invalid dispatcher */
 	egg_debug ("emitting exit %i", spawn->priv->exit);
@@ -331,7 +333,7 @@ out:
 /**
  * pk_spawn_exit:
  *
- * Just write "exit" into the open fd and hope the backend does the right thing
+ * Just write "exit" into the open fd and wait for backend to close
  *
  **/
 gboolean
@@ -347,8 +349,17 @@ pk_spawn_exit (PkSpawn *spawn)
 		return FALSE;
 	}
 
+	/* send command */
 	spawn->priv->is_sending_exit = TRUE;
 	ret = pk_spawn_send_stdin (spawn, "exit");
+
+	/* wait for the script to exit */
+	if (ret) {
+		g_main_loop_run (spawn->priv->exit_loop);
+		egg_debug ("instance exited");
+	}
+
+	spawn->priv->is_sending_exit = FALSE;
 	return ret;
 }
 
@@ -405,15 +416,12 @@ pk_spawn_argv (PkSpawn *spawn, gchar **argv, gchar **envp)
 
 		/* kill off existing instance */
 		egg_debug ("changing dispatcher (exit old instance)");
+		spawn->priv->is_changing_dispatcher = TRUE;
 		pk_spawn_exit (spawn);
-
-		/* wait for the script to exit */
-		g_main_loop_run (spawn->priv->exit_loop);
-		egg_debug ("old instance exited");
+		spawn->priv->is_changing_dispatcher = FALSE;
 	}
 
 	/* create spawned object for tracking */
-	spawn->priv->is_sending_exit = FALSE;
 	spawn->priv->finished = FALSE;
 	egg_debug ("creating new instance of %s", argv[0]);
 	ret = g_spawn_async_with_pipes (NULL, argv, envp,
@@ -502,6 +510,7 @@ pk_spawn_init (PkSpawn *spawn)
 	spawn->priv->kill_id = 0;
 	spawn->priv->finished = FALSE;
 	spawn->priv->is_sending_exit = FALSE;
+	spawn->priv->is_changing_dispatcher = FALSE;
 	spawn->priv->last_argv0 = NULL;
 	spawn->priv->last_envp = NULL;
 	spawn->priv->exit = PK_SPAWN_EXIT_TYPE_UNKNOWN;
commit 130f0a642453358c4a0fa849ad72d09cbf88b5ec
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Thu Oct 2 12:54:45 2008 +0100

    trivial: add two new yum comps mappings

diff --git a/backends/yum/yumComps.py b/backends/yum/yumComps.py
index 2b607c2..7bb1d7c 100755
--- a/backends/yum/yumComps.py
+++ b/backends/yum/yumComps.py
@@ -181,6 +181,8 @@ groupMap = {
 'rpmfusion_free;system-tools'                 : GROUP_SYSTEM,
 'rpmfusion_nonfree;games'                     : GROUP_GAMES,
 'rpmfusion_nonfree;hardware-support'          : GROUP_SYSTEM,
+'rpmfusion_nonfree;misc-tools'                : GROUP_SYSTEM,
+'rpmfusion_nonfree;emulators'                 : GROUP_OTHER,
 'rpmfusion_nonfree;base'                      : GROUP_SYSTEM
 }
 
commit 3a74f1fc4201bcef039b0642eca391994d019cd0
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Thu Oct 2 10:23:07 2008 +0100

    trivial: fix a few comments in PkSpawn

diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index ed07107..e7c4db7 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -252,8 +252,6 @@ pk_spawn_sigkill_cb (PkSpawn *spawn)
 /**
  * pk_spawn_kill:
  *
- * THIS IS A VERY DANGEROUS THING TO DO!
- *
  * We send SIGQUIT and after a few ms SIGKILL
  *
  **/
@@ -292,7 +290,7 @@ pk_spawn_kill (PkSpawn *spawn)
 /**
  * pk_spawn_send_stdin:
  *
- * Just write "exit" into the open fd and hope the backend does the right thing
+ * Send new comands to a running (but idle) dispatcher script
  *
  **/
 static gboolean
@@ -373,10 +371,6 @@ pk_spawn_argv (PkSpawn *spawn, gchar **argv, gchar **envp)
 	g_return_val_if_fail (argv != NULL, FALSE);
 
 	len = g_strv_length (argv);
-	if (len > 5) {
-		egg_debug ("limiting debugging to 5 entries");
-		len = 5;
-	}
 	for (i=0; i<len; i++)
 		egg_debug ("argv[%i] '%s'", i, argv[i]);
 	if (envp != NULL) {
commit 592e12a1795f88e1708622f63cb7f2822a723e38
Merge: 8d4915e... 2c8b0b7...
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Wed Oct 1 17:36:46 2008 +0100

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

commit 8d4915e4b7899f583c0299f0880e5a1cba2ee8ad
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Wed Oct 1 17:28:30 2008 +0100

    trivial: do the dbus-glib timeout in libpackagekit too

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index cab6c4f..2f13620 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -3308,6 +3308,10 @@ pk_client_set_tid (PkClient *client, const gchar *tid, GError **error)
 				     "Cannot connect to PackageKit tid %s", tid);
 		return FALSE;
 	}
+
+	/* don't timeout, as dbus-glib sets the timeout ~25 seconds */
+	dbus_g_proxy_set_default_timeout (proxy, INT_MAX);
+
 	client->priv->tid = g_strdup (tid);
 	egg_debug ("set tid %s on %p", client->priv->tid, client);
 
diff --git a/libpackagekit/pk-control.c b/libpackagekit/pk-control.c
index 71ae2f1..b73da02 100644
--- a/libpackagekit/pk-control.c
+++ b/libpackagekit/pk-control.c
@@ -832,6 +832,9 @@ pk_control_init (PkControl *control)
 	if (control->priv->proxy == NULL)
 		egg_error ("Cannot connect to PackageKit.");
 
+	/* don't timeout, as dbus-glib sets the timeout ~25 seconds */
+	dbus_g_proxy_set_default_timeout (control->priv->proxy, INT_MAX);
+
 	dbus_g_proxy_add_signal (control->priv->proxy, "TransactionListChanged",
 				 G_TYPE_STRV, G_TYPE_INVALID);
 	dbus_g_proxy_connect_signal (control->priv->proxy, "TransactionListChanged",
commit 8f08b36d11bbc1747368862c4350183469417d18
Author: Richard Hughes <hughsie at localhost.localdomain>
Date:   Wed Oct 1 17:26:28 2008 +0100

    bugfix: set the default timeout to the maximum as dbus-glib times out after 25 seconds and it may take longer to install a codec than that

diff --git a/contrib/gstreamer-plugin/pk-gstreamer-install.c b/contrib/gstreamer-plugin/pk-gstreamer-install.c
index c3a3b54..ba2f660 100644
--- a/contrib/gstreamer-plugin/pk-gstreamer-install.c
+++ b/contrib/gstreamer-plugin/pk-gstreamer-install.c
@@ -385,6 +385,9 @@ main (int argc, char **argv)
 						G_TYPE_STRING,
 						G_TYPE_INVALID));
 
+	/* don't timeout, as dbus-glib sets the timeout ~25 seconds */
+	dbus_g_proxy_set_default_timeout (proxy, INT_MAX);
+
 	/* invoke the method */
 	ret = dbus_g_proxy_call (proxy, "InstallGStreamerCodecs", &error,
 				 G_TYPE_UINT, xid,
commit 2c8b0b75a8a60d7c00da3061621f654104dcb075
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Oct 1 16:56:13 2008 +0100

    trivial spec fixes

diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index eae58dc..07c3d9f 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -147,8 +147,8 @@ Summary: Install GStreamer codecs using PackageKit
 Group: Development/Libraries
 Requires: gstreamer
 Requires: PackageKit-libs = %{version}-%{release}
-Obsoletes: codeina < 0.10.1-8
-Provides:  codeina = 0.10.1-8
+Obsoletes: codeina < 0.10.1
+Provides:  codeina = 0.10.1
 
 %description gstreamer-plugin
 The PackageKit GStreamer plugin allows any Gstreamer application to install
commit 2f45068de9f40fdaa5b1bf0b5b5d5b05838fb856
Merge: 4750862... 0bfdf73...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Tue Sep 30 23:47:59 2008 +0200

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

commit 475086259e2b1dda6c6ddd4526719e9eac8c1b6a
Merge: 9e841b9... dc719aa...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Mon Sep 29 17:15:05 2008 +0200

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

commit 9e841b982c6f059948f45d371ccfe2aff27a7444
Merge: 09b2a10... e6cb406...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Mon Sep 29 16:50:20 2008 +0200

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

commit 09b2a10ac994e4edc8d913f015b38e596fdc3bdb
Merge: 3a5d85d... 439f034...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Mon Sep 29 16:43:07 2008 +0200

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

commit 3a5d85d58e8f489e3019930b2a391c016cc2f607
Merge: 56b0fa5... bee4eb4...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Mon Sep 29 12:02:41 2008 +0200

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

commit 56b0fa533eefdec879cdf16f668e9a7e58dfae50
Merge: cec22c2... 91eb1d2...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Sun Sep 28 21:43:07 2008 +0200

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

commit cec22c265a8cceec4e66ab1ad9df3de2b794603c
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date:   Sun Sep 28 13:50:43 2008 +0200

    smart: use loader.getInstalled() instead of channel.getType()

diff --git a/backends/smart/smartBackend.py b/backends/smart/smartBackend.py
index 8e3eee0..a50c6f9 100755
--- a/backends/smart/smartBackend.py
+++ b/backends/smart/smartBackend.py
@@ -466,9 +466,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
             if self._package_passes_filters(package, filters):
                 paths = []
                 for loader in package.loaders:
-                    channel = loader.getChannel()
-                    if package.installed and not \
-                       channel.getType().endswith('-sys'):
+                    if package.installed and not loader.getInstalled():
                         continue
                     info = loader.getInfo(package)
                     paths = info.getPathList()
@@ -1066,8 +1064,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
             else:
                 status = INFO_UNKNOWN
         for loader in package.loaders:
-            channel = loader.getChannel()
-            if package.installed and not channel.getType().endswith('-sys') \
+            if package.installed and not loader.getInstalled() \
             and not self._package_is_collection(package):
                 continue
             info = loader.getInfo(package)


More information about the PackageKit-commit mailing list