[PackageKit-commit] packagekit: Branch 'PACKAGEKIT_0_1_X' - 44 commits

Richard Hughes hughsient at kemper.freedesktop.org
Fri Jun 13 00:46:05 PDT 2008


 Makefile.am                                  |    3 
 backends/conary/pk-backend-conary.c          |    2 
 backends/pisi/pk-backend-pisi.c              |    2 
 backends/smart/pk-backend-smart.c            |    2 
 backends/yum/helpers/yumBackend.py           |  827 ++++++++++++++-------------
 backends/yum/pk-backend-yum.c                |    2 
 backends/yum2/helpers/yumDBUSBackend.py      |   20 
 contrib/yum-packagekit/refresh-packagekit.py |    2 
 data/95packagekit                            |    2 
 data/Makefile.am                             |    3 
 docs/spec/pk-concepts.xml                    |   11 
 libpackagekit/pk-client.c                    |   15 
 libpackagekit/pk-common.c                    |  164 +++++
 libpackagekit/pk-common.h                    |    5 
 libpackagekit/pk-debug.h                     |    6 
 libpackagekit/pk-enum.c                      |   29 
 libpackagekit/pk-enum.h                      |   17 
 libpackagekit/pk-package-ids.c               |   43 -
 policy/org.freedesktop.packagekit.policy.in  |   29 
 python/packagekit/backend.py                 |    9 
 python/packagekit/daemonBackend.py           |   11 
 src/pk-backend-spawn.c                       |   48 -
 src/pk-backend-spawn.h                       |    1 
 src/pk-backend.c                             |   14 
 src/pk-engine.c                              |   12 
 src/pk-runner.c                              |   10 
 src/pk-spawn.c                               |   55 -
 src/pk-spawn.h                               |    4 
 tools/add-error-enum.sh                      |    2 
 29 files changed, 808 insertions(+), 542 deletions(-)

New commits:
commit d9e912b0aeb77038cc53bf65bd3d1222a3092fba
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri May 23 15:10:50 2008 +0100

    newline is a valid char, else the update descriptions look bad

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index 5cbee7b..708f8dc 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -238,7 +238,7 @@ pk_strsafe (const gchar *text)
 	}
 
 	/* rip out any insane characters */
-	delimiters = "\\\f\n\r\t\"'";
+	delimiters = "\\\f\r\t\"'";
 	text_safe = g_strdup (text);
 	g_strdelimit (text_safe, delimiters, ' ');
 	return text_safe;
commit ae6e7ec7c41db9dbbe55d036b0203a546455fef9
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Thu May 22 10:57:45 2008 -0400

    We never want to show self.txt, since it contains '(x/y) packagename' instead of just 'packagename'.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 7f49ae1..4663f37 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1498,11 +1498,7 @@ class DownloadCallback(BaseMeter):
         '''
         Get the name of the package being downloaded
         '''
-        if self.text and type(self.text) == type(""):
-            name = self.text
-        else:
-            name = self.basename
-        return name
+        return self.basename
 
     def updateProgress(self,name,frac,fread,ftime):
         '''
commit 27db53a5b77188b8283af8232ab7262ef26fb363
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu May 22 18:26:51 2008 +0100

    report to the user when the comps groups are invalid. Might help fix bugs like rh#447162

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 3a39014..7f49ae1 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -434,6 +434,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
     def _buildGroupDict(self):
         pkgGroups= {}
         cats = self.yumbase.comps.categories
+        if len(cats) == 0:
+            self.error(ERROR_GROUP_NOT_FOUND,'comps categories could not be loaded')
         for cat in cats:
             grps = map(lambda x: self.yumbase.comps.return_group(x),
                filter(lambda x: self.yumbase.comps.has_group(x),cat.groups))
commit 060a1ccd4095c52db975104746b16c4a5bc6b34b
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu May 22 18:21:46 2008 +0100

    yum: convert ';' chars in update description in to ',' to prevent a crash like in rh#447347

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 9dc5940..3a39014 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1331,6 +1331,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     typ = ref['type']
                     href = ref['href']
                     title = ref['title'] or ""
+
+                    # Description can sometimes have ';' in them, and we use that as the delimiter
+                    title = title.replace(";",",")
+
                     if href:
                         if typ in ('bugzilla','cve'):
                             urls[typ].append("%s;%s" % (href,title))
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 8a44d47..91d612e 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -1801,6 +1801,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 type_ = ref['type']
                 href = ref['href']
                 title = ref['title'] or ""
+
+                # Description can sometimes have ';' in them, and we use that as the delimiter
+                title = title.replace(";",",")
+
                 if href:
                     if type_ in ('bugzilla', 'cve'):
                         urls[type_].append("%s;%s" % (href, title))
commit 2ccd2e3503eeaca3b634ec05a97b8a297edb7958
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed May 14 09:17:45 2008 +0100

    Fix a backtrace when we try to use refresh-packagekit.py with an old daemon: catch all exceptions when we do StateHasChanged to fix rh#446331

diff --git a/contrib/yum-packagekit/refresh-packagekit.py b/contrib/yum-packagekit/refresh-packagekit.py
index 247be9b..1577a76 100644
--- a/contrib/yum-packagekit/refresh-packagekit.py
+++ b/contrib/yum-packagekit/refresh-packagekit.py
@@ -35,7 +35,7 @@ def posttrans_hook(conduit):
                                           '/org/freedesktop/PackageKit')
         packagekit_iface = dbus.Interface(packagekit_proxy, 'org.freedesktop.PackageKit')
         packagekit_iface.StateHasChanged()
-    except dbus.DBusException, e:
+    except Exception, e:
         conduit.info(2, "Unable to send message to PackageKit")
         conduit.info(6, "%s" %(e,))
 
commit 8c35f7b9bfdffa1751fe0077a63e8c38b8389343
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue May 6 09:15:15 2008 +0100

    don't use space as a delimiter in pk_va_list_to_argv, it breaks installing
    local files from directories with spaces in. fixes rh#445158

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index adec1d1..1259a06 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -318,7 +318,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 	}
 
 	/* send the complete list as stdin */
-	package_ids_temp = pk_package_ids_to_text (package_ids, " ");
+	package_ids_temp = pk_package_ids_to_text (package_ids, "|");
 	pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
 	g_free (package_ids_temp);
 }
diff --git a/backends/pisi/pk-backend-pisi.c b/backends/pisi/pk-backend-pisi.c
index 5a8d7a3..c9e5abe 100644
--- a/backends/pisi/pk-backend-pisi.c
+++ b/backends/pisi/pk-backend-pisi.c
@@ -307,7 +307,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 	}
 
 	/* send the complete list as stdin */
-	package_ids_temp = pk_package_ids_to_text (package_ids, " ");
+	package_ids_temp = pk_package_ids_to_text (package_ids, "|");
 	pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
 	g_free (package_ids_temp);
 }
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index c8ba33b..2777e20 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -215,7 +215,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 	}
 
 	/* send the complete list as stdin */
-	package_ids_temp = pk_package_ids_to_text (package_ids, " ");
+	package_ids_temp = pk_package_ids_to_text (package_ids, "|");
 	pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
 	g_free (package_ids_temp);
 }
diff --git a/backends/yum/pk-backend-yum.c b/backends/yum/pk-backend-yum.c
index 0f81915..ec7d233 100644
--- a/backends/yum/pk-backend-yum.c
+++ b/backends/yum/pk-backend-yum.c
@@ -315,7 +315,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
 	}
 
 	/* send the complete list as stdin */
-	package_ids_temp = pk_package_ids_to_text (package_ids, " ");
+	package_ids_temp = pk_package_ids_to_text (package_ids, "|");
 	pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
 	g_free (package_ids_temp);
 }
diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index ab36732..5cbee7b 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -672,7 +672,7 @@ pk_va_list_to_argv_string (GPtrArray *ptr_array, const gchar *string)
 	guint i;
 
 	/* split the string up by spaces */
-	array = g_strsplit (string, " ", 0);
+	array = g_strsplit (string, "|", 0);
 
 	/* for each */
 	length = g_strv_length (array);
@@ -688,7 +688,7 @@ pk_va_list_to_argv_string (GPtrArray *ptr_array, const gchar *string)
  * @args: any subsequant string's
  *
  * Form a composite string array of string, with a special twist;
- * if the entry contains a space, then it is split as seporate parts
+ * if the entry contains a '|', then it is split as seporate parts
  * of the array.
  *
  * Return value: the string array, or %NULL if invalid
@@ -930,7 +930,7 @@ libst_common (LibSelfTest *test)
 
 	/************************************************************/
 	libst_title (test, "va_list_to_argv triple with space first");
-	array = pk_va_list_to_argv_test ("richard phillip", "hughes", NULL);
+	array = pk_va_list_to_argv_test ("richard|phillip", "hughes", NULL);
 	if (pk_strequal (array[0], "richard") &&
 	    pk_strequal (array[1], "phillip") &&
 	    pk_strequal (array[2], "hughes") &&
@@ -943,7 +943,7 @@ libst_common (LibSelfTest *test)
 
 	/************************************************************/
 	libst_title (test, "va_list_to_argv triple with space second");
-	array = pk_va_list_to_argv_test ("richard", "phillip hughes", NULL);
+	array = pk_va_list_to_argv_test ("richard", "phillip|hughes", NULL);
 	if (pk_strequal (array[0], "richard") &&
 	    pk_strequal (array[1], "phillip") &&
 	    pk_strequal (array[2], "hughes") &&
commit 8f9e627d281ee083a894b434bfd74e244920dc70
Author: Luke Macken <lmacken at redhat.com>
Date:   Mon May 5 10:57:17 2008 -0400

    yum: Fix a bug in _get_update_extras caused by invalid tab->space conversion (rh#304527)

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index af2324f..9dc5940 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1329,14 +1329,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             if refs:
                 for ref in refs:
                     typ = ref['type']
-            href = ref['href']
-            title = ref['title']
-            if typ in ('bugzilla','cve') and href != None:
-                if title == None:
-                    title = ""
-                urls[typ].append("%s;%s" % (href,title))
-            else:
-                urls['vendor'].append("%s;%s" % (ref['href'],ref['title']))
+                    href = ref['href']
+                    title = ref['title'] or ""
+                    if href:
+                        if typ in ('bugzilla','cve'):
+                            urls[typ].append("%s;%s" % (href,title))
+                        else:
+                            urls['vendor'].append("%s;%s" % (href,ref['title']))
 
             # Reboot flag
             if notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']:
commit 2352f86fdb003b94382eefcc8b9d208f01b77d7d
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu May 1 23:30:07 2008 +0100

    backport a fix from master so that we don't inhibit twice for each transaction. fixes rh#444612

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 2f4e507..b57adb3 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -38,7 +38,6 @@
 #include "pk-backend-internal.h"
 #include "pk-backend.h"
 #include "pk-time.h"
-#include "pk-inhibit.h"
 
 #define PK_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_BACKEND, PkBackendPrivate))
 
@@ -87,7 +86,6 @@ struct _PkBackendPrivate
 	PkRoleEnum		 role; /* this never changes for the lifetime of a transaction */
 	PkStatusEnum		 status; /* this changes */
 	PkExitEnum		 exit;
-	PkInhibit		*inhibit;
 	gboolean		 during_initialize;
 	gboolean		 allow_cancel;
 	gboolean		 finished;
@@ -901,13 +899,6 @@ pk_backend_set_allow_cancel (PkBackend *backend, gboolean allow_cancel)
 		return FALSE;
 	}
 
-	/* remove or add the hal inhibit */
-	if (allow_cancel) {
-		pk_inhibit_remove (backend->priv->inhibit, backend);
-	} else {
-		pk_inhibit_add (backend->priv->inhibit, backend);
-	}
-
 	/* can we do the action? */
 	if (backend->desc->cancel != NULL) {
 		backend->priv->allow_cancel = allow_cancel;
@@ -1077,9 +1068,6 @@ pk_backend_finished (PkBackend *backend)
 	/* we can't ever be re-used */
 	backend->priv->finished = TRUE;
 
-	/* remove any inhibit */
-	pk_inhibit_remove (backend->priv->inhibit, backend);
-
 	/* we have to run this idle as the command may finish before the transaction
 	 * has been sent to the client. I love async... */
 	pk_debug ("adding finished %p to timeout loop", backend);
@@ -1166,7 +1154,6 @@ pk_backend_finalize (GObject *object)
 	pk_debug ("backend finalise");
 
 	g_object_unref (backend->priv->time);
-	g_object_unref (backend->priv->inhibit);
 
 	/* do finish now, as we might be unreffing quickly */
 	if (backend->priv->signal_finished != 0) {
@@ -1310,7 +1297,6 @@ pk_backend_init (PkBackend *backend)
 	backend->priv->signal_error_timeout = 0;
 	backend->priv->during_initialize = FALSE;
 	backend->priv->time = pk_time_new ();
-	backend->priv->inhibit = pk_inhibit_new ();
 	pk_backend_reset (backend);
 }
 
diff --git a/src/pk-runner.c b/src/pk-runner.c
index 8876c67..d028761 100644
--- a/src/pk-runner.c
+++ b/src/pk-runner.c
@@ -1035,6 +1035,9 @@ pk_runner_finished_cb (PkBackend *backend, PkExitEnum exit, PkRunner *runner)
 		return;
 	}
 
+	/* remove any inhibit */
+	pk_inhibit_remove (runner->priv->inhibit, runner);
+
 	/* we should get no more from the backend with this tid */
 	runner->priv->finished = TRUE;
 }
@@ -1068,6 +1071,13 @@ pk_runner_allow_cancel_cb (PkBackend *backend, gboolean allow_cancel, PkRunner *
 	g_return_if_fail (PK_IS_RUNNER (runner));
 	g_return_if_fail (runner->priv->backend->desc->cancel != NULL);
 
+	/* remove or add the hal inhibit */
+	if (allow_cancel) {
+		pk_inhibit_remove (runner->priv->inhibit, runner);
+	} else {
+		pk_inhibit_add (runner->priv->inhibit, runner);
+	}
+
 	pk_debug ("AllowCancel now %i", allow_cancel);
 	runner->priv->allow_cancel = allow_cancel;
 }
commit 657b9e30e64a1678410e1e219df3f0fc7a6fac9f
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 30 11:58:00 2008 +0100

    when we find a package by it's repo id, make sure we take into account the NEVRA _and_ the repo_id. Fixes rh#443976

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index ea5ad74..af2324f 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -32,8 +32,8 @@ from yum.rpmtrans import RPMBaseCallback
 from yum.constants import *
 from yum.update_md import UpdateMetadata
 from yum.callbacks import *
-from yum.misc import prco_tuple_to_string, unique
-from yum.packages import YumLocalPackage
+from yum.misc import prco_tuple_to_string,unique
+from yum.packages import YumLocalPackage, parsePackages
 from yum.packageSack import MetaSack
 import rpmUtils
 import exceptions
@@ -203,10 +203,10 @@ GUI_KEYS = re.compile(r'(qt)|(gtk)')
 class GPGKeyNotImported(exceptions.Exception):
     pass
 
-def sigquit(signum, frame):
-    print >> sys.stderr, "Quit signal sent - exiting immediately"
+def sigquit(signum,frame):
+    print >> sys.stderr,"Quit signal sent - exiting immediately"
     if yumbase:
-        print >> sys.stderr, "unlocking backend"
+        print >> sys.stderr,"unlocking backend"
         yumbase.closeRpmDB()
         yumbase.doUnlock(YUM_PID_FILE)
     sys.exit(1)
@@ -214,28 +214,28 @@ def sigquit(signum, frame):
 class PackageKitYumBackend(PackageKitBaseBackend):
 
     # Packages there require a reboot
-    rebootpkgs = ("kernel", "kernel-smp", "kernel-xen-hypervisor", "kernel-PAE",
-              "kernel-xen0", "kernel-xenU", "kernel-xen", "kernel-xen-guest",
-              "glibc", "hal", "dbus", "xen")
+    rebootpkgs = ("kernel","kernel-smp","kernel-xen-hypervisor","kernel-PAE",
+              "kernel-xen0","kernel-xenU","kernel-xen","kernel-xen-guest",
+              "glibc","hal","dbus","xen")
 
     def handle_repo_error(func):
-        def wrapper(*args, **kwargs):
+        def wrapper(*args,**kwargs):
             self = args[0]
 
             try:
-                func(*args, **kwargs)
+                func(*args,**kwargs)
             except yum.Errors.RepoError,e:
                 self._refresh_yum_cache()
 
                 try:
-                    func(*args, **kwargs)
-                except yum.Errors.RepoError, e:
+                    func(*args,**kwargs)
+                except yum.Errors.RepoError,e:
                     self.error(ERROR_NO_CACHE,str(e))
 
         return wrapper
 
     def __init__(self,args,lock=True):
-        signal.signal(signal.SIGQUIT, sigquit)
+        signal.signal(signal.SIGQUIT,sigquit)
         PackageKitBaseBackend.__init__(self,args)
         self.yumbase = PackageKitYumBase(self)
         yumbase = self.yumbase
@@ -268,10 +268,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         summary = self._to_unicode(summary)
         PackageKitBaseBackend.package(self,id,status,summary)
 
-    def _to_unicode(self, txt, encoding='utf-8'):
-        if isinstance(txt, basestring):
-            if not isinstance(txt, unicode):
-                txt = unicode(txt, encoding, errors='replace')
+    def _to_unicode(self,txt,encoding='utf-8'):
+        if isinstance(txt,basestring):
+            if not isinstance(txt,unicode):
+                txt = unicode(txt,encoding,errors='replace')
         return txt
 
     def doLock(self):
@@ -279,7 +279,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         retries = 0
         while not self.isLocked():
             try: # Try to lock yum
-                self.yumbase.doLock( YUM_PID_FILE )
+                self.yumbase.doLock(YUM_PID_FILE)
                 PackageKitBaseBackend.doLock(self)
             except:
                 time.sleep(2)
@@ -314,7 +314,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         @param filters: package types to search (all,installed,available)
         @param key: key to seach for
         '''
-        res = self.yumbase.searchGenerator(searchlist, [key])
+        res = self.yumbase.searchGenerator(searchlist,[key])
         fltlist = filters.split(';')
         installed_nevra = [] # yum returns packages as available even when installed
         pkg_list = [] # only do the second iteration on not installed pkgs
@@ -344,17 +344,17 @@ class PackageKitYumBackend(PackageKitBaseBackend):
     def _do_extra_filtering(self,pkg,filterList):
         ''' do extra filtering (gui,devel etc) '''
         for filter in filterList:
-            if filter in (FILTER_INSTALLED, FILTER_NOT_INSTALLED):
-                if not self._do_installed_filtering(filter, pkg):
+            if filter in (FILTER_INSTALLED,FILTER_NOT_INSTALLED):
+                if not self._do_installed_filtering(filter,pkg):
                     return False
-            elif filter in (FILTER_GUI, FILTER_NOT_GUI):
-                if not self._do_gui_filtering(filter, pkg):
+            elif filter in (FILTER_GUI,FILTER_NOT_GUI):
+                if not self._do_gui_filtering(filter,pkg):
                     return False
-            elif filter in (FILTER_DEVELOPMENT, FILTER_NOT_DEVELOPMENT):
-                if not self._do_devel_filtering(filter, pkg):
+            elif filter in (FILTER_DEVELOPMENT,FILTER_NOT_DEVELOPMENT):
+                if not self._do_devel_filtering(filter,pkg):
                     return False
-            elif filter in (FILTER_FREE, FILTER_NOT_FREE):
-                if not self._do_free_filtering(filter, pkg):
+            elif filter in (FILTER_FREE,FILTER_NOT_FREE):
+                if not self._do_free_filtering(filter,pkg):
                     return False
         return True
 
@@ -417,7 +417,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         searchlist = ['name']
         self.status(STATUS_QUERY)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
-        self._do_search(searchlist, filters, key)
+        self._do_search(searchlist,filters,key)
 
     def search_details(self,filters,key):
         '''
@@ -427,16 +427,16 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.allow_cancel(True)
         self.percentage(None)
 
-        searchlist = ['name', 'summary', 'description', 'group']
+        searchlist = ['name','summary','description','group']
         self.status(STATUS_QUERY)
-        self._do_search(searchlist, filters, key)
+        self._do_search(searchlist,filters,key)
 
     def _buildGroupDict(self):
         pkgGroups= {}
         cats = self.yumbase.comps.categories
         for cat in cats:
-            grps = map( lambda x: self.yumbase.comps.return_group( x ),
-               filter( lambda x: self.yumbase.comps.has_group( x ), cat.groups ) )
+            grps = map(lambda x: self.yumbase.comps.return_group(x),
+               filter(lambda x: self.yumbase.comps.has_group(x),cat.groups))
             grplist = []
             for group in grps:
                 for pkg in group.mandatory_packages.keys():
@@ -477,7 +477,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                         if groupMap.has_key(cg):
                             group = groupMap[cg]           # use the pk group name, instead of yum 'category/group'
                     if group == key:
-                        if self._do_extra_filtering(pkg, fltlist):
+                        if self._do_extra_filtering(pkg,fltlist):
                             package_list.append((pkg,INFO_INSTALLED))
                     installed_nevra.append(self._get_nevra(pkg))
 
@@ -492,7 +492,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                             if groupMap.has_key(cg):
                                 group = groupMap[cg]
                         if group == key:
-                            if self._do_extra_filtering(pkg, fltlist):
+                            if self._do_extra_filtering(pkg,fltlist):
                                 package_list.append((pkg,INFO_AVAILABLE))
 
         except yum.Errors.GroupsError,e:
@@ -560,8 +560,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             matches = self.yumbase.rpmdb.searchFiles(key)
             for pkg in matches:
                 if not found.has_key(str(pkg)):
-                    if self._do_extra_filtering(pkg, fltlist):
-                        self._show_package(pkg, INFO_INSTALLED)
+                    if self._do_extra_filtering(pkg,fltlist):
+                        self._show_package(pkg,INFO_INSTALLED)
                         found[str(pkg)] = 1
         if not FILTER_INSTALLED in fltlist:
             # Check available for file
@@ -569,12 +569,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             matches = self.yumbase.pkgSack.searchFiles(key)
             for pkg in matches:
                 if not found.has_key(str(pkg)):
-                    if self._do_extra_filtering(pkg, fltlist):
-                        self._show_package(pkg, INFO_AVAILABLE)
+                    if self._do_extra_filtering(pkg,fltlist):
+                        self._show_package(pkg,INFO_AVAILABLE)
                         found[str(pkg)] = 1
 
     @handle_repo_error
-    def what_provides(self, filters, provides_type, search):
+    def what_provides(self,filters,provides_type,search):
         '''
         Implement the {backend}-what-provides functionality
         '''
@@ -590,16 +590,16 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             matches = self.yumbase.rpmdb.searchProvides(search)
             for pkg in matches:
                 if not found.has_key(str(pkg)):
-                    if self._do_extra_filtering(pkg, fltlist):
-                        self._show_package(pkg, INFO_INSTALLED)
+                    if self._do_extra_filtering(pkg,fltlist):
+                        self._show_package(pkg,INFO_INSTALLED)
                         found[str(pkg)] = 1
         if not FILTER_INSTALLED in fltlist:
             # Check available for file
             matches = self.yumbase.pkgSack.searchProvides(search)
             for pkg in matches:
                 if found.has_key(str(pkg)):
-                    if self._do_extra_filtering(pkg, fltlist):
-                        self._show_package(pkg, INFO_AVAILABLE)
+                    if self._do_extra_filtering(pkg,fltlist):
+                        self._show_package(pkg,INFO_AVAILABLE)
                         found[str(pkg)] = 1
 
     def _getEVR(self,idver):
@@ -630,7 +630,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             e = v = r = a = None
         # search the rpmdb for the nevra
         pkgs = self.yumbase.rpmdb.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
-        # if the package is found, then return it
+        # if the package is found, then return it (do not have to match the repo_id)
         if len(pkgs) != 0:
             return pkgs[0],True
         # search the pkgSack for the nevra
@@ -638,13 +638,20 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             pkgs = self.yumbase.pkgSack.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
         except yum.Errors.RepoError,e:
             self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
-        # if the package is found, then return it
-        if len(pkgs) != 0:
-            return pkgs[0],False
-        else:
+        # nothing found
+        if len(pkgs) == 0:
             return None,False
-
-    def _get_pkg_requirements(self,pkg,reqlist=[] ):
+        # one NEVRA in a single repo
+        if len(pkgs) == 1:
+            return pkgs[0],False
+        # we might have the same NEVRA in multiple repos, match by repo name
+        for pkg in pkgs:
+            if d == pkg.repoid:
+                return pkg,False
+        # repo id did not match
+        return None,False
+
+    def _get_pkg_requirements(self,pkg,reqlist=[]):
         pkgs = self.yumbase.rpmdb.searchRequires(pkg.name)
         reqlist.extend(pkgs)
         if pkgs:
@@ -678,7 +685,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
     def _is_inst(self,pkg):
         return self.yumbase.rpmdb.installed(po=pkg)
 
-    def _installable(self, pkg, ematch=False):
+    def _installable(self,pkg,ematch=False):
 
         """check if the package is reasonably installable, true/false"""
 
@@ -771,13 +778,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         for pkg in deps:
             if pkg.name != name:
                 pkgver = self._get_package_ver(pkg)
-                id = self.get_package_id(pkg.name, pkgver, pkg.arch, pkg.repoid)
+                id = self.get_package_id(pkg.name,pkgver,pkg.arch,pkg.repoid)
 
                 if self._is_inst(pkg) and FILTER_NOT_INSTALLED not in fltlist:
-                    self.package(id, INFO_INSTALLED, pkg.summary)
+                    self.package(id,INFO_INSTALLED,pkg.summary)
                 else:
                     if self._installable(pkg) and FILTER_INSTALLED not in fltlist:
-                        self.package(id, INFO_AVAILABLE, pkg.summary)
+                        self.package(id,INFO_AVAILABLE,pkg.summary)
 
     def update_system(self):
         '''
@@ -822,10 +829,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
             for repo in self.yumbase.repos.listEnabled():
                 repo.metadata_expire = 0
-                self.yumbase.repos.populateSack(which=[repo.id], mdtype='metadata', cacheonly=1)
+                self.yumbase.repos.populateSack(which=[repo.id],mdtype='metadata',cacheonly=1)
                 pct+=bump
                 self.percentage(pct)
-                self.yumbase.repos.populateSack(which=[repo.id], mdtype='filelists', cacheonly=1)
+                self.yumbase.repos.populateSack(which=[repo.id],mdtype='filelists',cacheonly=1)
                 pct+=bump
                 self.percentage(pct)
 
@@ -835,13 +842,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             #we might have a rounding error
             self.percentage(100)
 
-        except yum.Errors.RepoError, e:
+        except yum.Errors.RepoError,e:
             self.error(ERROR_REPO_CONFIGURATION_ERROR,str(e))
-        except yum.Errors.YumBaseError, e:
+        except yum.Errors.YumBaseError,e:
             self.error(ERROR_UNKNOWN,str(e))
 
     @handle_repo_error
-    def resolve(self, filters, name):
+    def resolve(self,filters,name):
         '''
         Implement the {backend}-resolve functionality
         '''
@@ -872,7 +879,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                         break
 
     @handle_repo_error
-    def install(self, packages):
+    def install(self,packages):
         '''
         Implement the {backend}-install functionality
         This will only work with yum 3.2.4 or higher
@@ -899,7 +906,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             if newest.EVR > po.EVR:
                 self.message(MESSAGE_WARNING,"A newer version of %s is available online." % po.name)
 
-    def install_file (self, inst_file):
+    def install_file (self,inst_file):
         '''
         Implement the {backend}-install_file functionality
         Install the package containing the inst_file file
@@ -928,7 +935,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         except yum.Errors.InstallError,e:
             self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
-        except (yum.Errors.RepoError, yum.Errors.PackageSackError, IOError):
+        except (yum.Errors.RepoError,yum.Errors.PackageSackError,IOError):
             # We might not be able to connect to the internet to get
             # repository metadata, or the package might not exist.
             # Try again, (temporarily) disabling repos first.
@@ -948,7 +955,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
                 
 
-    def update(self, packages):
+    def update(self,packages):
         '''
         Implement the {backend}-install functionality
         This will only work with yum 3.2.4 or higher
@@ -977,7 +984,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             pkg = txmbr.po
             # check if package is in reboot list or flagged with reboot_suggested
             # in the update metadata and is installed/updated etc
-            notice = md.get_notice((pkg.name, pkg.version, pkg.release))
+            notice = md.get_notice((pkg.name,pkg.version,pkg.release))
             if (pkg.name in self.rebootpkgs \
                 or (notice and notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']))\
                 and txmbr.ts_state in TS_INSTALL_STATES:
@@ -985,7 +992,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 break
 
     def _format_msgs(self,msgs):
-        if isinstance(msgs, basestring):
+        if isinstance(msgs,basestring):
             msgs = msgs.split('\n')
         return ";".join(msgs)
 
@@ -1013,11 +1020,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 callback = ProcessTransPackageKitCallback(self)
                 self.yumbase.processTransaction(callback=callback,
                                       rpmDisplay=rpmDisplay)
-            except yum.Errors.YumDownloadError, ye:
+            except yum.Errors.YumDownloadError,ye:
                 self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,self._format_msgs(ye.value))
-            except yum.Errors.YumGPGCheckError, ye:
+            except yum.Errors.YumGPGCheckError,ye:
                 self.error(ERROR_BAD_GPG_SIGNATURE,self._format_msgs(ye.value))
-            except GPGKeyNotImported, e:
+            except GPGKeyNotImported,e:
                 keyData = self.yumbase.missingGPGKey
                 if not keyData:
                     self.error(ERROR_BAD_GPG_SIGNATURE,
@@ -1033,14 +1040,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                                              keyData['timestamp'],
                                              'GPG')
                 self.error(ERROR_GPG_FAILURE,"GPG key %s required" % keyData['hexkeyid'])
-            except yum.Errors.YumBaseError, ye:
+            except yum.Errors.YumBaseError,ye:
                 message = self._format_msgs(ye.value)
                 if message.find ("conflicts with file") != -1:
                     self.error(ERROR_FILE_CONFLICTS,message)
                 else:
                     self.error(ERROR_TRANSACTION_ERROR,message)
 
-    def remove(self, allowdep, package):
+    def remove(self,allowdep,package):
         '''
         Implement the {backend}-remove functionality
         Needed to be implemented in a sub class
@@ -1050,7 +1057,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(0)
         self.status(STATUS_RUNNING)
 
-        pkg,inst = self._findPackage( package)
+        pkg,inst = self._findPackage(package)
         if pkg and inst:
             try:
                 txmbr = self.yumbase.remove(name=pkg.name)
@@ -1066,7 +1073,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         else:
             self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package %s is not installed" % package)
 
-    def get_description(self, package):
+    def get_description(self,package):
         '''
         Print a detailed description for a given package
         '''
@@ -1083,15 +1090,15 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     def _show_description(self,pkg):
         pkgver = self._get_package_ver(pkg)
-        id = self.get_package_id(pkg.name, pkgver, pkg.arch, pkg.repo)
+        id = self.get_package_id(pkg.name,pkgver,pkg.arch,pkg.repo)
         desc = pkg.description
         desc = desc.replace('\n\n',';')
         desc = desc.replace('\n',' ')
 
-        self.description(id, pkg.license, "unknown", desc, pkg.url,
+        self.description(id,pkg.license,"unknown",desc,pkg.url,
                          pkg.size)
 
-    def get_files(self, package):
+    def get_files(self,package):
         self._check_init()
         self.allow_cancel(True)
         self.percentage(None)
@@ -1104,19 +1111,19 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
             file_list = ";".join(files)
 
-            self.files(package, file_list)
+            self.files(package,file_list)
         else:
             self.error(ERROR_PACKAGE_NOT_FOUND,'Package %s was not found' % package)
 
     def _pkg_to_id(self,pkg):
         pkgver = self._get_package_ver(pkg)
-        id = self.get_package_id(pkg.name, pkgver, pkg.arch, pkg.repo)
+        id = self.get_package_id(pkg.name,pkgver,pkg.arch,pkg.repo)
         return id
 
     def _show_package(self,pkg,status):
         '''  Show info about package'''
         id = self._pkg_to_id(pkg)
-        self.package(id,status, pkg.summary)
+        self.package(id,status,pkg.summary)
 
     def _get_status(self,notice):
         ut = notice['type']
@@ -1129,7 +1136,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         else:
             return INFO_UNKNOWN
 
-    def _is_main_package(self, repo):
+    def _is_main_package(self,repo):
         if repo.endswith('-debuginfo'):
             return False
         if repo.endswith('-devel'):
@@ -1138,7 +1145,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             return False
         return True
 
-    def _basename_filter(self, package_list):
+    def _basename_filter(self,package_list):
         '''
         Filter the list so that the number of packages are reduced.
         This is done by only displaying gtk2 rather than gtk2-devel, gtk2-debuginfo, etc.
@@ -1181,7 +1188,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 base_list_already_got.append ((base,version))
         return output_list
 
-    def get_updates(self, filters):
+    def get_updates(self,filters):
         '''
         Implement the {backend}-get-updates functionality
         @param filters: package types to show
@@ -1200,9 +1207,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         md = self.updateMetadata
         for pkg in ygl.updates:
-            if self._do_extra_filtering(pkg, fltlist):
+            if self._do_extra_filtering(pkg,fltlist):
                 # Get info about package in updates info
-                notice = md.get_notice((pkg.name, pkg.version, pkg.release))
+                notice = md.get_notice((pkg.name,pkg.version,pkg.release))
                 if notice:
                     status = self._get_status(notice)
                     package_list.append((pkg,status))
@@ -1217,7 +1224,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             for (pkg,status) in package_list:
                 self._show_package(pkg,status)
 
-    def repo_enable(self, repoid, enable):
+    def repo_enable(self,repoid,enable):
         '''
         Implement the {backend}-repo-enable functionality
         '''
@@ -1235,7 +1242,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         except yum.Errors.RepoError,e:
             self.error(ERROR_REPO_NOT_FOUND,str(e))
 
-    def _is_development_repo(self, repo):
+    def _is_development_repo(self,repo):
         if repo.endswith('-debuginfo'):
             return True
         if repo.endswith('-testing'):
@@ -1248,7 +1255,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             return True
         return False
 
-    def get_repo_list(self, filters):
+    def get_repo_list(self,filters):
         '''
         Implement the {backend}-get-repo-list functionality
         '''
@@ -1263,10 +1270,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     self.repo_detail(repo.id,repo.name,'false')
 
     def _get_obsoleted(self,name):
-        obsoletes = self.yumbase.up.getObsoletesTuples( newest=1 )
-        for ( obsoleting, installed ) in obsoletes:
+        obsoletes = self.yumbase.up.getObsoletesTuples(newest=1)
+        for (obsoleting,installed) in obsoletes:
             if obsoleting[0] == name:
-                pkg =  self.yumbase.rpmdb.searchPkgTuple( installed )[0]
+                pkg =  self.yumbase.rpmdb.searchPkgTuple(installed)[0]
                 return self._pkg_to_id(pkg)
         return ""
 
@@ -1312,8 +1319,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     def _get_update_extras(self,pkg):
         md = self.updateMetadata
-        notice = md.get_notice((pkg.name, pkg.version, pkg.release))
-        urls = {'bugzilla':[], 'cve' : [], 'vendor': []}
+        notice = md.get_notice((pkg.name,pkg.version,pkg.release))
+        urls = {'bugzilla':[],'cve' : [],'vendor': []}
         if notice:
             # Update Description
             desc = notice['description']
@@ -1357,7 +1364,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         vendor_url = self._format_list(urls['vendor'])
         self.update_detail(package,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc)
 
-    def repo_set_data(self, repoid, parameter, value):
+    def repo_set_data(self,repoid,parameter,value):
         '''
         Implement the {backend}-repo-set-data functionality
         '''
@@ -1365,10 +1372,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         # Get the repo
         repo = self.yumbase.repos.getRepo(repoid)
         if repo:
-            repo.cfg.set(repoid, parameter, value)
+            repo.cfg.set(repoid,parameter,value)
             try:
-                repo.cfg.write(file(repo.repofile, 'w'))
-            except IOError, e:
+                repo.cfg.write(file(repo.repofile,'w'))
+            except IOError,e:
                 self.error(ERROR_CANNOT_WRITE_REPO_CONFIG,str(e))
         else:
             self.error(ERROR_REPO_NOT_FOUND,'repo %s not found' % repoid)
@@ -1381,8 +1388,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         pkg,inst = self._findPackage(package)
         if pkg:
             try:
-                self.yumbase.getKeyForPackage(pkg, askcb = lambda x, y, z: True)
-            except yum.Errors.YumBaseError, e:
+                self.yumbase.getKeyForPackage(pkg,askcb = lambda x,y,z: True)
+            except yum.Errors.YumBaseError,e:
                 self.error(ERROR_UNKNOWN,str(e))
             except:
                 self.error(ERROR_GPG_FAILURE,"Error importing GPG Key for %s" % pkg)
@@ -1405,9 +1412,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.repos.setCache(0)
 
         try:
-            self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
-            self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
-            self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
+            self.yumbase.repos.populateSack(mdtype='metadata',cacheonly=1)
+            self.yumbase.repos.populateSack(mdtype='filelists',cacheonly=1)
+            self.yumbase.repos.populateSack(mdtype='otherdata',cacheonly=1)
         except yum.Errors.RepoError,e:
             self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
 
@@ -1418,12 +1425,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)     # Setup Yum Config
         self.yumbase.conf.throttle = "90%"                        # Set bandwidth throttle to 40%
         self.dnlCallback = DownloadCallback(self,showNames=True)  # Download callback
-        self.yumbase.repos.setProgressBar( self.dnlCallback )     # Setup the download callback class
+        self.yumbase.repos.setProgressBar(self.dnlCallback)       # Setup the download callback class
 
-class DownloadCallback( BaseMeter ):
+class DownloadCallback(BaseMeter):
     """ Customized version of urlgrabber.progress.BaseMeter class """
     def __init__(self,base,showNames = False):
-        BaseMeter.__init__( self )
+        BaseMeter.__init__(self)
         self.totSize = ""
         self.base = base
         self.showNames = showNames
@@ -1443,7 +1450,7 @@ class DownloadCallback( BaseMeter ):
     def _getPackage(self,name):
         if self.pkgs:
             for pkg in self.pkgs:
-                if isinstance(pkg, YumLocalPackage):
+                if isinstance(pkg,YumLocalPackage):
                     rpmfn = pkg.localPkg
                 else:
                     rpmfn = os.path.basename(pkg.remote_path) # get the rpm filename of the package
@@ -1451,34 +1458,34 @@ class DownloadCallback( BaseMeter ):
                     return pkg
         return None
 
-    def update( self, amount_read, now=None ):
-        BaseMeter.update( self, amount_read, now )
+    def update(self,amount_read,now=None):
+        BaseMeter.update(self,amount_read,now)
 
-    def _do_start( self, now=None ):
+    def _do_start(self,now=None):
         name = self._getName()
         self.updateProgress(name,0.0,"","")
         if not self.size is None:
-            self.totSize = format_number( self.size )
+            self.totSize = format_number(self.size)
 
-    def _do_update( self, amount_read, now=None ):
-        fread = format_number( amount_read )
+    def _do_update(self,amount_read,now=None):
+        fread = format_number(amount_read)
         name = self._getName()
         if self.size is None:
             # Elapsed time
             etime = self.re.elapsed_time()
-            fetime = format_time( etime )
+            fetime = format_time(etime)
             frac = 0.0
             self.updateProgress(name,frac,fread,fetime)
         else:
             # Remaining time
             rtime = self.re.remaining_time()
-            frtime = format_time( rtime )
+            frtime = format_time(rtime)
             frac = self.re.fraction_read()
             self.updateProgress(name,frac,fread,frtime)
 
-    def _do_end( self, amount_read, now=None ):
-        total_time = format_time( self.re.elapsed_time() )
-        total_size = format_number( amount_read )
+    def _do_end(self,amount_read,now=None):
+        total_time = format_time(self.re.elapsed_time())
+        total_size = format_number(amount_read)
         name = self._getName()
         self.updateProgress(name,1.0,total_size,total_time)
 
@@ -1486,7 +1493,7 @@ class DownloadCallback( BaseMeter ):
         '''
         Get the name of the package being downloaded
         '''
-        if self.text and type( self.text ) == type( "" ):
+        if self.text and type(self.text) == type(""):
             name = self.text
         else:
             name = self.basename
@@ -1500,7 +1507,7 @@ class DownloadCallback( BaseMeter ):
         @param fread: formated string containing BytesRead
         @param ftime : formated string containing remaining or elapsed time
         '''
-        pct = int( frac*100 )
+        pct = int(frac*100)
         if name != self.oldName: # If this a new package
             if self.oldName:
                 self.base.sub_percentage(100)
@@ -1562,22 +1569,22 @@ class PackageKitCallback(RPMBaseCallback):
             id = self.base.get_package_id(self.curpkg,'','','')
         else:
             pkgver = self.base._get_package_ver(self.curpkg)
-            id = self.base.get_package_id(self.curpkg.name, pkgver, self.curpkg.arch, self.curpkg.repo)
-        self.base.package(id,status, "")
+            id = self.base.get_package_id(self.curpkg.name,pkgver,self.curpkg.arch,self.curpkg.repo)
+        self.base.package(id,status,"")
 
-    def event(self, package, action, te_current, te_total, ts_current, ts_total):
+    def event(self,package,action,te_current,te_total,ts_current,ts_total):
         if str(package) != str(self.curpkg):
             self.curpkg = package
             self.base.status(self.state_actions[action])
             self._showName(self.info_actions[action])
-            pct = self._calcTotalPct(ts_current, ts_total)
+            pct = self._calcTotalPct(ts_current,ts_total)
             self.base.percentage(pct)
         val = (ts_current*100L)/ts_total
         if val != self.pct:
             self.pct = val
             self.base.sub_percentage(val)
 
-    def errorlog(self, msg):
+    def errorlog(self,msg):
         # grrrrrrrr
         pass
 
@@ -1610,7 +1617,7 @@ class DepSolveCallback(object):
 
     # XXX takes a PackageKitBackend so we can call StatusChanged on it.
     # That's kind of hurky.
-    def __init__(self, backend):
+    def __init__(self,backend):
         self.started = False
         self.backend = backend
 
@@ -1620,10 +1627,10 @@ class DepSolveCallback(object):
            self.backend.percentage(None)
 
     # Be lazy and not define the others explicitly
-    def _do_nothing(self, *args, **kwargs):
+    def _do_nothing(self,*args,**kwargs):
         pass
 
-    def __getattr__(self, x):
+    def __getattr__(self,x):
         return self._do_nothing
 
 class PackageKitYumBase(yum.YumBase):
@@ -1632,7 +1639,7 @@ class PackageKitYumBase(yum.YumBase):
     and nab the gpg sig data
     """
 
-    def __init__(self, backend):
+    def __init__(self,backend):
         yum.YumBase.__init__(self)
         self.missingGPGKey = None
         self.dsCallback = DepSolveCallback(backend)
@@ -1642,22 +1649,24 @@ class PackageKitYumBase(yum.YumBase):
         # This can be overloaded by a subclass.
 
         for po in pkgs:
-            result, errmsg = self.sigCheckPkg(po)
+            result,errmsg = self.sigCheckPkg(po)
             if result == 0:
-                # Verified ok, or verify not req'd
+                # verified ok, or verify not required
                 continue
             elif result == 1:
-                self.getKeyForPackage(po, fullaskcb=self._fullAskForGPGKeyImport)
+                # verify failed but installation of the correct GPG key might help
+                self.getKeyForPackage(po,fullaskcb=self._fullAskForGPGKeyImport)
             else:
-                raise yum.Errors.YumGPGCheckError, errmsg
+                # fatal GPG verification error
+                raise yum.Errors.YumGPGCheckError,errmsg
         return 0
 
-    def _fullAskForGPGKeyImport(self, data):
+    def _fullAskForGPGKeyImport(self,data):
         self.missingGPGKey = data
 
         raise GPGKeyNotImported()
 
-    def _askForGPGKeyImport(self, po, userid, hexkeyid):
+    def _askForGPGKeyImport(self,po,userid,hexkeyid):
         '''
         Ask for GPGKeyImport
         '''
commit 45cf0f898e7bdce6dd55ceda3eec452e4756e81a
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Apr 25 16:55:56 2008 +0100

    remove some debugging code that was causing the daemon to crash. Fixes rh#443972

diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index fc3a800..31d15ee 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -317,12 +317,6 @@ pk_backend_spawn_parse_stdout (PkBackendSpawn *backend_spawn, const gchar *line)
 		pk_backend_no_percentage_updates (backend_spawn->priv->backend);
 	} else if (pk_strequal (command, "repo-signature-required")) {
 
-		if (size != 9+99) {
-			pk_error ("invalid command '%s'", command);
-			ret = FALSE;
-			goto out;
-		}
-
 		sig_type = pk_sig_type_enum_from_text (sections[8]);
 		if (sig_type == PK_SIGTYPE_ENUM_UNKNOWN) {
 			pk_backend_message (backend_spawn->priv->backend, PK_MESSAGE_ENUM_DAEMON,
commit f6c0f90c73f79f2bd079232bf1bc6aab6fcdd78f
Author: James Antill <james at and.org>
Date:   Tue Apr 22 12:46:44 2008 -0400

    Don't leak argv

diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index e19fa32..fc3a800 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -485,6 +485,7 @@ pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, const gchar *exe
 		pk_backend_finished (backend_spawn->priv->backend);
 	}
 	g_free (filename);
+	g_strfreev (argv);
 	return ret;
 }
 
commit 5b1f60980c440a73a5498fd22420bfdc7ebc95bb
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 23 21:46:24 2008 +0100

    fix pk_va_list_to_argv so that it splits lines with spaces as seporate entries.
    This fixes the recent regression where the yum backend could not select updates because
    the packageid's were being treated as a single entry in the GStrv.

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index 6f18f27..ab36732 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -662,11 +662,34 @@ pk_ptr_array_to_argv (GPtrArray *array)
 }
 
 /**
+ * pk_va_list_to_argv_string:
+ **/
+static void
+pk_va_list_to_argv_string (GPtrArray *ptr_array, const gchar *string)
+{
+	gchar **array;
+	guint length;
+	guint i;
+
+	/* split the string up by spaces */
+	array = g_strsplit (string, " ", 0);
+
+	/* for each */
+	length = g_strv_length (array);
+	for (i=0; i<length; i++) {
+		g_ptr_array_add (ptr_array, g_strdup (array[i]));
+	}
+	g_strfreev (array);
+}
+
+/**
  * pk_va_list_to_argv:
  * @string_first: the first string
  * @args: any subsequant string's
  *
- * Form a composite string array of string
+ * Form a composite string array of string, with a special twist;
+ * if the entry contains a space, then it is split as seporate parts
+ * of the array.
  *
  * Return value: the string array, or %NULL if invalid
  **/
@@ -683,11 +706,16 @@ pk_va_list_to_argv (const gchar *string_first, va_list *args)
 
 	/* find how many elements we have in a temp array */
 	ptr_array = g_ptr_array_new ();
-	g_ptr_array_add (ptr_array, g_strdup (string_first));
+	pk_va_list_to_argv_string (ptr_array, string_first);
+
+	/* process all the va_list entries */
 	for (i=0;; i++) {
 		value_temp = va_arg (*args, gchar *);
+		/* end of array */
 		if (value_temp == NULL) break;
-		g_ptr_array_add (ptr_array, g_strdup (value_temp));
+
+		/* split the string up by spaces */
+		pk_va_list_to_argv_string (ptr_array, value_temp);
 	}
 	pk_debug ("number of strings=%i", i+1);
 
@@ -768,6 +796,20 @@ pk_strbuild_test (const gchar *first_element, ...)
 	return text;
 }
 
+static gchar **
+pk_va_list_to_argv_test (const gchar *first_element, ...)
+{
+	va_list args;
+	gchar **array;
+
+	/* get the argument list */
+	va_start (args, first_element);
+	array = pk_va_list_to_argv (first_element, &args);
+	va_end (args);
+
+	return array;
+}
+
 void
 libst_common (LibSelfTest *test)
 {
@@ -861,6 +903,58 @@ libst_common (LibSelfTest *test)
 	g_free (text_safe);
 
 	/************************************************************
+	 ****************      splitting va_list       **************
+	 ************************************************************/
+	libst_title (test, "va_list_to_argv single");
+	array = pk_va_list_to_argv_test ("richard", NULL);
+	if (pk_strequal (array[0], "richard") &&
+	    array[1] == NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, "incorrect array '%s'", array[0]);
+	}
+	g_strfreev (array);
+
+	/************************************************************/
+	libst_title (test, "va_list_to_argv triple");
+	array = pk_va_list_to_argv_test ("richard", "phillip", "hughes", NULL);
+	if (pk_strequal (array[0], "richard") &&
+	    pk_strequal (array[1], "phillip") &&
+	    pk_strequal (array[2], "hughes") &&
+	    array[3] == NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, "incorrect array '%s','%s','%s'", array[0], array[1], array[2]);
+	}
+	g_strfreev (array);
+
+	/************************************************************/
+	libst_title (test, "va_list_to_argv triple with space first");
+	array = pk_va_list_to_argv_test ("richard phillip", "hughes", NULL);
+	if (pk_strequal (array[0], "richard") &&
+	    pk_strequal (array[1], "phillip") &&
+	    pk_strequal (array[2], "hughes") &&
+	    array[3] == NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, "incorrect array '%s','%s','%s'", array[0], array[1], array[2]);
+	}
+	g_strfreev (array);
+
+	/************************************************************/
+	libst_title (test, "va_list_to_argv triple with space second");
+	array = pk_va_list_to_argv_test ("richard", "phillip hughes", NULL);
+	if (pk_strequal (array[0], "richard") &&
+	    pk_strequal (array[1], "phillip") &&
+	    pk_strequal (array[2], "hughes") &&
+	    array[3] == NULL) {
+		libst_success (test, NULL);
+	} else {
+		libst_failed (test, "incorrect array '%s','%s','%s'", array[0], array[1], array[2]);
+	}
+	g_strfreev (array);
+
+	/************************************************************
 	 ****************        validate text         **************
 	 ************************************************************/
 	libst_title (test, "validate correct char 1");
commit 079e92bfb9cb633535eefbb55f048e598517d769
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Apr 20 23:37:29 2008 +0100

    add a make snapshot target for rpm builds

diff --git a/Makefile.am b/Makefile.am
index 87cfa32..6ae669e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,9 @@ gprof:
 	cat gprof.txt
 endif
 
+snapshot:
+	$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%Y%m%d"`
+
 DISTCLEANFILES =					\
 	PackageKit-*.tar.gz				\
 	packagekit.pc					\
commit 0971abd3d69e93daa0bf8b9095cb83aeb74ed7fd
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Apr 21 15:53:07 2008 +0100

    properly handle exceptions locally rather than using customTracebackHandler. fixes rh#443342

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c1e6fce..ea5ad74 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -230,7 +230,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 try:
                     func(*args, **kwargs)
                 except yum.Errors.RepoError, e:
-                    self.error(ERROR_NO_CACHE,"Package cache is invalid and could not be rebuilt.")
+                    self.error(ERROR_NO_CACHE,str(e))
 
         return wrapper
 
@@ -417,7 +417,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         searchlist = ['name']
         self.status(STATUS_QUERY)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
-
         self._do_search(searchlist, filters, key)
 
     def search_details(self,filters,key):
@@ -430,7 +429,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         searchlist = ['name', 'summary', 'description', 'group']
         self.status(STATUS_QUERY)
-
         self._do_search(searchlist, filters, key)
 
     def _buildGroupDict(self):
@@ -498,7 +496,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                                 package_list.append((pkg,INFO_AVAILABLE))
 
         except yum.Errors.GroupsError,e:
-            self.error(ERROR_GROUP_NOT_FOUND,e)
+            self.error(ERROR_GROUP_NOT_FOUND,str(e))
 
         # basename filter if specified
         if FILTER_BASENAME in fltlist:
@@ -636,7 +634,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         if len(pkgs) != 0:
             return pkgs[0],True
         # search the pkgSack for the nevra
-        pkgs = self.yumbase.pkgSack.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
+        try:
+            pkgs = self.yumbase.pkgSack.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         # if the package is found, then return it
         if len(pkgs) != 0:
             return pkgs[0],False
@@ -668,8 +669,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             if txmbrs:
                 rc,msgs =  self.yumbase.buildTransaction()
                 if rc !=2:
-                    retmsg = "Error in Dependency Resolution;" + self._format_msgs(msgs)
-                    self.error(ERROR_DEP_RESOLUTION_FAILED,retmsg)
+                    self.error(ERROR_DEP_RESOLUTION_FAILED,self._format_msgs(msgs))
                 else:
                     for txmbr in self.yumbase.tsInfo:
                         if txmbr.po.name != pkg.name:
@@ -761,12 +761,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         fltlist = filters.split(';')
         name = package.split(';')[0]
+
         pkg,inst = self._findPackage(package)
         results = {}
         if pkg:
             deps = self._get_best_dependencies(pkg)
         else:
-            self.error(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
+            self.error(ERROR_PACKAGE_NOT_FOUND,'Package %s was not found' % package)
         for pkg in deps:
             if pkg.name != name:
                 pkgver = self._get_package_ver(pkg)
@@ -791,7 +792,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.conf.throttle = "60%" # Set bandwidth throttle to 60%
                                            # to avoid taking all the system's bandwidth.
 
-        txmbr = self.yumbase.update() # Add all updates to Transaction
+        try:
+            txmbr = self.yumbase.update() # Add all updates to Transaction
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         if txmbr:
             self._runYumTransaction()
         else:
@@ -832,7 +836,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.percentage(100)
 
         except yum.Errors.RepoError, e:
-            self.error(ERROR_REPO_CONFIGURATION_ERROR, str(e))
+            self.error(ERROR_REPO_CONFIGURATION_ERROR,str(e))
         except yum.Errors.YumBaseError, e:
             self.error(ERROR_UNKNOWN,str(e))
 
@@ -920,11 +924,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 if len(self.yumbase.tsInfo) > 0:
                     self._runYumTransaction()
             else:
-                self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s " % inst_file)
+                self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
 
         except yum.Errors.InstallError,e:
-            msgs = ';'.join(e)
-            self.error(ERROR_LOCAL_INSTALL_FAILED,msgs)
+            self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
         except (yum.Errors.RepoError, yum.Errors.PackageSackError, IOError):
             # We might not be able to connect to the internet to get
             # repository metadata, or the package might not exist.
@@ -940,10 +943,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                             self.yumbase.tsInfo.pkgSack = MetaSack()
                         self._runYumTransaction()
                 else:
-                    self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s " % inst_file)
+                    self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
             except yum.Errors.InstallError,e:
-                msgs = ';'.join(e)
-                self.error(ERROR_LOCAL_INSTALL_FAILED, msgs)
+                self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
                 
 
     def update(self, packages):
@@ -956,11 +958,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(0)
         self.status(STATUS_RUNNING)
         txmbrs = []
-        for package in packages:
-            pkg,inst = self._findPackage(package)
-            if pkg:
-                txmbr = self.yumbase.update(name=pkg.name)
-                txmbrs.extend(txmbr)
+        try:
+            for package in packages:
+                pkg,inst = self._findPackage(package)
+                if pkg:
+                    txmbr = self.yumbase.update(name=pkg.name)
+                    txmbrs.extend(txmbr)
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         if txmbrs:
             self._runYumTransaction()
         else:
@@ -989,10 +994,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         Run the yum Transaction
         This will only work with yum 3.2.4 or higher
         '''
-        rc,msgs =  self.yumbase.buildTransaction()
+        try:
+            rc,msgs =  self.yumbase.buildTransaction()
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         if rc !=2:
-            retmsg = "Error in Dependency Resolution;" + self._format_msgs(msgs)
-            self.error(ERROR_DEP_RESOLUTION_FAILED,retmsg)
+            self.error(ERROR_DEP_RESOLUTION_FAILED,self._format_msgs(msgs))
         else:
             self._check_for_reboot()
             if removedeps == False:
@@ -1007,11 +1014,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 self.yumbase.processTransaction(callback=callback,
                                       rpmDisplay=rpmDisplay)
             except yum.Errors.YumDownloadError, ye:
-                retmsg = "Error in Download;" + self._format_msgs(ye.value)
-                self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,retmsg)
+                self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,self._format_msgs(ye.value))
             except yum.Errors.YumGPGCheckError, ye:
-                retmsg = "Error in Package Signatures;" + self._format_msgs(ye.value)
-                self.error(ERROR_BAD_GPG_SIGNATURE,retmsg)
+                self.error(ERROR_BAD_GPG_SIGNATURE,self._format_msgs(ye.value))
             except GPGKeyNotImported, e:
                 keyData = self.yumbase.missingGPGKey
                 if not keyData:
@@ -1027,7 +1032,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                                              keyData['fingerprint'],
                                              keyData['timestamp'],
                                              'GPG')
-                self.error(ERROR_GPG_FAILURE,"GPG key not imported.")
+                self.error(ERROR_GPG_FAILURE,"GPG key %s required" % keyData['hexkeyid'])
             except yum.Errors.YumBaseError, ye:
                 message = self._format_msgs(ye.value)
                 if message.find ("conflicts with file") != -1:
@@ -1047,16 +1052,19 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         pkg,inst = self._findPackage( package)
         if pkg and inst:
-            txmbr = self.yumbase.remove(name=pkg.name)
+            try:
+                txmbr = self.yumbase.remove(name=pkg.name)
+            except yum.Errors.RepoError,e:
+                self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
             if txmbr:
                 if allowdep != 'yes':
                     self._runYumTransaction(removedeps=False)
                 else:
                     self._runYumTransaction(removedeps=True)
             else:
-                self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package is not installed")
+                self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package %s is not installed" % package)
         else:
-            self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package is not installed")
+            self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package %s is not installed" % package)
 
     def get_description(self, package):
         '''
@@ -1071,7 +1079,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         if pkg:
             self._show_description(pkg)
         else:
-            self.error(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
+            self.error(ERROR_PACKAGE_NOT_FOUND,'Package %s was not found' % package)
 
     def _show_description(self,pkg):
         pkgver = self._get_package_ver(pkg)
@@ -1098,7 +1106,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
             self.files(package, file_list)
         else:
-            self.error(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
+            self.error(ERROR_PACKAGE_NOT_FOUND,'Package %s was not found' % package)
 
     def _pkg_to_id(self,pkg):
         pkgver = self._get_package_ver(pkg)
@@ -1186,7 +1194,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         fltlist = filters.split(';')
         package_list = []
 
-        ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
+        try:
+            ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
         md = self.updateMetadata
         for pkg in ygl.updates:
             if self._do_extra_filtering(pkg, fltlist):
@@ -1222,7 +1233,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     repo.enablePersistent()
 
         except yum.Errors.RepoError,e:
-            self.error(ERROR_REPO_NOT_FOUND, "repo %s is not found" % repoid)
+            self.error(ERROR_REPO_NOT_FOUND,str(e))
 
     def _is_development_repo(self, repo):
         if repo.endswith('-debuginfo'):
@@ -1393,9 +1404,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.conf.cache = 0
         self.yumbase.repos.setCache(0)
 
-        self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
-        self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
-        self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
+        try:
+            self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
+            self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
+            self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
+        except yum.Errors.RepoError,e:
+            self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
 
         self.yumbase.conf.cache = old_cache_setting
         self.yumbase.repos.setCache(old_cache_setting)
@@ -1406,23 +1420,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.dnlCallback = DownloadCallback(self,showNames=True)  # Download callback
         self.yumbase.repos.setProgressBar( self.dnlCallback )     # Setup the download callback class
 
-    def customTracebackHandler(self,tb):
-        '''
-        Custom Traceback Handler
-        this is called by the ExceptionHandler
-        return True if the exception is handled in the method.
-        return False if to do the default action an signal an error
-        to packagekit.
-        Overload this method if you what handle special Tracebacks
-        '''
-        if issubclass(tb, yum.Errors.RepoError):
-            # Unhandled Repo error, can be network problems
-            
-            self.error(ERROR_REPO_NOT_AVAILABLE, "Problem connecting to software source.  This can be caused by network problems or a misconfiguration.")
-            return True
-        else: # Do the default stuff
-            return False
-
 class DownloadCallback( BaseMeter ):
     """ Customized version of urlgrabber.progress.BaseMeter class """
     def __init__(self,base,showNames = False):
commit 761d25e7d11a640ee8744fec3c5b924a77705157
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Apr 21 09:46:44 2008 -0400

    Fix for bug #443341 - RefreshYumcache not defined.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 80d7ec8..c1e6fce 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -418,10 +418,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.status(STATUS_QUERY)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
 
-        try:
-            self._do_search(searchlist, filters, key)
-        except RefreshYumCacheFailed, e:
-            return
+        self._do_search(searchlist, filters, key)
 
     def search_details(self,filters,key):
         '''
@@ -434,10 +431,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         searchlist = ['name', 'summary', 'description', 'group']
         self.status(STATUS_QUERY)
 
-        try:
-            self._do_search(searchlist, filters, key)
-        except RefreshYumCacheFailed, e:
-            return
+        self._do_search(searchlist, filters, key)
 
     def _buildGroupDict(self):
         pkgGroups= {}
commit 65d00f29a967adff582bc2de9bb27fc0f9a72f2c
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 17:02:26 2008 +0100

    add a new error enum: PK_ERROR_ENUM_MISSING_GPG_SIGNATURE

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index bdee567..0e4bab5 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -129,20 +129,21 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_REPO_NOT_FOUND,		"repo-not-found"},
 	{PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,	"cannot-remove-system-package"},
 	{PK_ERROR_ENUM_PROCESS_KILL,		"process-kill"},
-        {PK_ERROR_ENUM_FAILED_INITIALIZATION,   "failed-initialization"},
-        {PK_ERROR_ENUM_FAILED_FINALISE,         "failed-finalise"},
+	{PK_ERROR_ENUM_FAILED_INITIALIZATION,	"failed-initialization"},
+	{PK_ERROR_ENUM_FAILED_FINALISE,		"failed-finalise"},
 	{PK_ERROR_ENUM_FAILED_CONFIG_PARSING,	"failed-config-parsing"},
 	{PK_ERROR_ENUM_CANNOT_CANCEL,		"cannot-cancel"},
-	{PK_ERROR_ENUM_CANNOT_GET_LOCK,         "cannot-get-lock"},
-	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,   "no-packages-to-update"},
-	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,        "cannot-write-repo-config"},
-	{PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,    "local-install-failed"},
-	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,       "bad-gpg-signature"},
-	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
-	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
+	{PK_ERROR_ENUM_CANNOT_GET_LOCK,		"cannot-get-lock"},
+	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,	"no-packages-to-update"},
+	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG, "cannot-write-repo-config"},
+	{PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,	"local-install-failed"},
+	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,	"bad-gpg-signature"},
+	{PK_ERROR_ENUM_MISSING_GPG_SIGNATURE,	"missing-gpg-signature"},
+	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,	"cannot-install-source-package"},
+	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,	"repo-configuration-error"},
 	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
 	{PK_ERROR_ENUM_FILE_CONFLICTS,		"file-conflicts"},
-	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,      "repo-not-available"},
+	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,	"repo-not-available"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index ae2559b..57e09d0 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -222,6 +222,7 @@ typedef enum {
 	PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,
 	PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,
 	PK_ERROR_ENUM_BAD_GPG_SIGNATURE,
+	PK_ERROR_ENUM_MISSING_GPG_SIGNATURE,
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
diff --git a/tools/add-error-enum.sh b/tools/add-error-enum.sh
index a643237..7e55ef2 100755
--- a/tools/add-error-enum.sh
+++ b/tools/add-error-enum.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-$EDITOR docs/spec/pk-introduction.xml libpackagekit/pk-enum.h libpackagekit/pk-enum.c ../gnome-packagekit/src/pk-common-gui.c python/packagekit/backend.py
+$EDITOR docs/spec/pk-introduction.xml libpackagekit/pk-enum.h libpackagekit/pk-enum.c ../gnome-packagekit/src/gpk-common.c
 
commit 2eb3de85a6db66dd6266d15fbda3cc5d2ce938e6
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 22 11:49:03 2008 -0400

    Since we disable existing repos, we have to manually init pkgSack.  Yuck.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 0ce3bbe..80d7ec8 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -34,6 +34,7 @@ from yum.update_md import UpdateMetadata
 from yum.callbacks import *
 from yum.misc import prco_tuple_to_string, unique
 from yum.packages import YumLocalPackage
+from yum.packageSack import MetaSack
 import rpmUtils
 import exceptions
 import types
@@ -941,6 +942,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 txmbr = self.yumbase.installLocal(inst_file)
                 if txmbr:
                     if len(self.yumbase.tsInfo) > 0:
+                        if not self.yumbase.tsInfo.pkgSack:
+                            self.yumbase.tsInfo.pkgSack = MetaSack()
                         self._runYumTransaction()
                 else:
                     self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s " % inst_file)
commit 21c1a81e26c311623617a5bc4d516ddb86cc651f
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Apr 20 22:04:09 2008 +0100

    add the new enums to support the metadata downloading

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index e770d8d..bdee567 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -69,6 +69,12 @@ static PkEnumMatch enum_status[] = {
 	{PK_STATUS_ENUM_REQUEST,		"request"},
 	{PK_STATUS_ENUM_FINISHED,		"finished"},
 	{PK_STATUS_ENUM_CANCEL,			"cancel"},
+	{PK_STATUS_ENUM_DOWNLOAD_REPOSITORY,	"download-repository"},
+	{PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST,	"download-package"},
+	{PK_STATUS_ENUM_DOWNLOAD_FILELIST,	"download-filelist"},
+	{PK_STATUS_ENUM_DOWNLOAD_CHANGELOG,	"download-changelog"},
+	{PK_STATUS_ENUM_DOWNLOAD_GROUP,		"download-group"},
+	{PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO,	"download-updateinfo"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 7773f14..ae2559b 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -114,6 +114,12 @@ typedef enum {
 	PK_STATUS_ENUM_REQUEST,
 	PK_STATUS_ENUM_FINISHED,
 	PK_STATUS_ENUM_CANCEL,
+	PK_STATUS_ENUM_DOWNLOAD_REPOSITORY,
+	PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST,
+	PK_STATUS_ENUM_DOWNLOAD_FILELIST,
+	PK_STATUS_ENUM_DOWNLOAD_CHANGELOG,
+	PK_STATUS_ENUM_DOWNLOAD_GROUP,
+	PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO,
 	PK_STATUS_ENUM_UNKNOWN
 } PkStatusEnum;
 
commit 0ec2efea2d27a47bc73736413f471f4b2e3228f3
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Apr 20 21:53:29 2008 +0100

    don't rely on a space to seporate the command list, as this breaks installing local files from directories with spaces in them. Fix looks huge (but isn't) and fixes things properly to use strv arrays when passing data. fixes rh#443235

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 12a56f5..0ce3bbe 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -925,11 +925,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 if len(self.yumbase.tsInfo) > 0:
                     self._runYumTransaction()
             else:
-                self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
+                self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s " % inst_file)
 
         except yum.Errors.InstallError,e:
             msgs = ';'.join(e)
-            self.error(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
+            self.error(ERROR_LOCAL_INSTALL_FAILED,msgs)
         except (yum.Errors.RepoError, yum.Errors.PackageSackError, IOError):
             # We might not be able to connect to the internet to get
             # repository metadata, or the package might not exist.
diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index 841ee38..6f18f27 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -632,6 +632,74 @@ pk_delay_yield (gfloat delay)
 }
 
 /**
+ * pk_ptr_array_to_argv:
+ * @array: the GPtrArray of strings
+ *
+ * Form a composite string array of strings.
+ * The data in the GPtrArray is copied.
+ *
+ * Return value: the string array, or %NULL if invalid
+ **/
+gchar **
+pk_ptr_array_to_argv (GPtrArray *array)
+{
+	gchar **strv_array;
+	const gchar *value_temp;
+	guint i;
+
+	g_return_val_if_fail (array != NULL, NULL);
+
+	/* copy the array to a strv */
+	strv_array = g_new0 (gchar *, array->len + 2);
+	for (i=0; i<array->len; i++) {
+		value_temp = (const gchar *) g_ptr_array_index (array, i);
+		strv_array[i] = g_strdup (value_temp);
+	}
+	/* set the last element to NULL */
+	strv_array[i] = NULL;
+
+	return strv_array;
+}
+
+/**
+ * pk_va_list_to_argv:
+ * @string_first: the first string
+ * @args: any subsequant string's
+ *
+ * Form a composite string array of string
+ *
+ * Return value: the string array, or %NULL if invalid
+ **/
+gchar **
+pk_va_list_to_argv (const gchar *string_first, va_list *args)
+{
+	GPtrArray *ptr_array;
+	gchar **array;
+	gchar *value_temp;
+	guint i;
+
+	g_return_val_if_fail (args != NULL, NULL);
+	g_return_val_if_fail (string_first != NULL, NULL);
+
+	/* find how many elements we have in a temp array */
+	ptr_array = g_ptr_array_new ();
+	g_ptr_array_add (ptr_array, g_strdup (string_first));
+	for (i=0;; i++) {
+		value_temp = va_arg (*args, gchar *);
+		if (value_temp == NULL) break;
+		g_ptr_array_add (ptr_array, g_strdup (value_temp));
+	}
+	pk_debug ("number of strings=%i", i+1);
+
+	/* convert the array to a strv type */
+	array = pk_ptr_array_to_argv (ptr_array);
+
+	/* get rid of the array, and free the contents */
+	g_ptr_array_free (ptr_array, TRUE);
+	return array;
+}
+
+/**
  * pk_strbuild_va:
  * @first_element: The first string item, or NULL
  * @args: the va_list
diff --git a/libpackagekit/pk-common.h b/libpackagekit/pk-common.h
index 26d114d..7f62d83 100644
--- a/libpackagekit/pk-common.h
+++ b/libpackagekit/pk-common.h
@@ -98,6 +98,11 @@ gchar		**pk_strsplit				(const gchar	*id,
 gchar		*pk_strbuild_va				(const gchar	*first_element,
 							 va_list	*args)
 							 G_GNUC_WARN_UNUSED_RESULT;
+gchar		**pk_ptr_array_to_argv			(GPtrArray	*array)
+							 G_GNUC_WARN_UNUSED_RESULT;
+gchar		**pk_va_list_to_argv			(const gchar	*string_first,
+							 va_list	*args)
+							 G_GNUC_WARN_UNUSED_RESULT;
 gboolean	 pk_strcmp_sections			(const gchar	*id1,
 							 const gchar	*id2,
 							 guint		 parts,
diff --git a/libpackagekit/pk-package-ids.c b/libpackagekit/pk-package-ids.c
index fd1ca6b..933da1f 100644
--- a/libpackagekit/pk-package-ids.c
+++ b/libpackagekit/pk-package-ids.c
@@ -51,23 +51,7 @@
 gchar **
 pk_package_ids_from_array (GPtrArray *array)
 {
-	gchar **strv_array;
-	const gchar *value_temp;
-	guint i;
-
-	g_return_val_if_fail (array != NULL, NULL);
-
-	/* copy the temp array to a strv */
-	strv_array = g_new0 (gchar *, array->len + 2);
-	for (i=0; i<array->len; i++) {
-		value_temp = (const gchar *) g_ptr_array_index (array, i);
-		/* we don't need to copy the copy */
-		strv_array[i] = g_strdup (value_temp);
-	}
-	/* set the last element to NULL */
-	strv_array[i] = NULL;
-
-	return strv_array;
+	return pk_ptr_array_to_argv (array);
 }
 
 /**
@@ -82,30 +66,7 @@ pk_package_ids_from_array (GPtrArray *array)
 gchar **
 pk_package_ids_from_va_list (const gchar *package_id_first, va_list *args)
 {
-	GPtrArray *data;
-	gchar **array;
-	gchar *value_temp;
-	guint i;
-
-	g_return_val_if_fail (args != NULL, NULL);
-	g_return_val_if_fail (package_id_first != NULL, NULL);
-
-	/* find how many elements we have in a temp array */
-	data = g_ptr_array_new ();
-	g_ptr_array_add (data, g_strdup (package_id_first));
-	for (i=0;; i++) {
-		value_temp = va_arg (*args, gchar *);
-		if (value_temp == NULL) break;
-		g_ptr_array_add (data, g_strdup (value_temp));
-	}
-	pk_debug ("number of packages=%i", i+1);
-
-	/* convert the array to a strv type */
-	array = pk_package_ids_from_array (data);
-
-	/* get rid of the array, and free the contents */
-	g_ptr_array_free (data, TRUE);
-	return array;
+	return pk_va_list_to_argv (package_id_first, args);
 }
 
 /**
diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index 497c281..e19fa32 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -441,45 +441,50 @@ pk_backend_spawn_helper_new (PkBackendSpawn *backend_spawn)
 }
 
 /**
- * pk_backend_spawn_helper_internal:
+ * pk_backend_spawn_helper_va_list:
  **/
 static gboolean
-pk_backend_spawn_helper_internal (PkBackendSpawn *backend_spawn, const gchar *script, const gchar *argument)
+pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, const gchar *executable, va_list *args)
 {
 	gboolean ret;
 	gchar *filename;
-	gchar *command;
+	gchar **argv;
 
 	g_return_val_if_fail (PK_IS_BACKEND_SPAWN (backend_spawn), FALSE);
 
+	/* convert to a argv */
+	argv = pk_va_list_to_argv (executable, args);
+	if (argv == NULL) {
+		pk_warning ("argv NULL");
+		return FALSE;
+	}
+
 #if PK_BUILD_LOCAL
 	/* prefer the local version */
-	filename = g_build_filename ("..", "backends", backend_spawn->priv->name, "helpers", script, NULL);
+	filename = g_build_filename ("..", "backends", backend_spawn->priv->name, "helpers", argv[0], NULL);
 	if (g_file_test (filename, G_FILE_TEST_EXISTS) == FALSE) {
 		pk_debug ("local helper not found '%s'", filename);
 		g_free (filename);
-		filename = g_build_filename (DATADIR, "PackageKit", "helpers", backend_spawn->priv->name, script, NULL);
+		filename = g_build_filename (DATADIR, "PackageKit", "helpers", backend_spawn->priv->name, argv[0], NULL);
 	}
 #else
-	filename = g_build_filename (DATADIR, "PackageKit", "helpers", backend_spawn->priv->name, script, NULL);
+	filename = g_build_filename (DATADIR, "PackageKit", "helpers", backend_spawn->priv->name, argv[0], NULL);
 #endif
 	pk_debug ("using spawn filename %s", filename);
 
-	if (argument != NULL) {
-		command = g_strdup_printf ("%s %s", filename, argument);
-	} else {
-		command = g_strdup (filename);
-	}
+	/* replace the filename with the full path */
+	g_free (argv[0]);
+	argv[0] = g_strdup (filename);
 
 	pk_backend_spawn_helper_new (backend_spawn);
-	ret = pk_spawn_command (backend_spawn->priv->spawn, command);
+	ret = pk_spawn_argv (backend_spawn->priv->spawn, argv);
 	if (!ret) {
 		pk_backend_spawn_helper_delete (backend_spawn);
-		pk_backend_error_code (backend_spawn->priv->backend, PK_ERROR_ENUM_INTERNAL_ERROR, "Spawn of helper '%s' failed", command);
+		pk_backend_error_code (backend_spawn->priv->backend, PK_ERROR_ENUM_INTERNAL_ERROR,
+				       "Spawn of helper '%s' failed", argv[0]);
 		pk_backend_finished (backend_spawn->priv->backend);
 	}
 	g_free (filename);
-	g_free (command);
 	return ret;
 }
 
@@ -527,22 +532,20 @@ pk_backend_spawn_kill (PkBackendSpawn *backend_spawn)
  * pk_backend_spawn_helper:
  **/
 gboolean
-pk_backend_spawn_helper (PkBackendSpawn *backend_spawn, const gchar *script, const gchar *first_element, ...)
+pk_backend_spawn_helper (PkBackendSpawn *backend_spawn, const gchar *first_element, ...)
 {
 	gboolean ret;
 	va_list args;
-	gchar *arguments;
 
 	g_return_val_if_fail (PK_IS_BACKEND_SPAWN (backend_spawn), FALSE);
+	g_return_val_if_fail (first_element != NULL, FALSE);
 	g_return_val_if_fail (backend_spawn->priv->name != NULL, FALSE);
 
 	/* get the argument list */
 	va_start (args, first_element);
-	arguments = pk_strbuild_va (first_element, &args);
+	ret = pk_backend_spawn_helper_va_list (backend_spawn, first_element, &args);
 	va_end (args);
 
-	ret = pk_backend_spawn_helper_internal (backend_spawn, script, arguments);
-	g_free (arguments);
 	return ret;
 }
 
diff --git a/src/pk-backend-spawn.h b/src/pk-backend-spawn.h
index cff414a..e9fb20d 100644
--- a/src/pk-backend-spawn.h
+++ b/src/pk-backend-spawn.h
@@ -52,7 +52,6 @@ typedef struct
 GType		 pk_backend_spawn_get_type		(void) G_GNUC_CONST;
 PkBackendSpawn	*pk_backend_spawn_new			(void);
 gboolean	 pk_backend_spawn_helper		(PkBackendSpawn	*backend_spawn,
-							 const gchar	*script,
 							 const gchar	*first_element, ...);
 gboolean	 pk_backend_spawn_kill			(PkBackendSpawn	*backend_spawn);
 const gchar	*pk_backend_spawn_get_name		(PkBackendSpawn	*backend_spawn);
diff --git a/src/pk-spawn.c b/src/pk-spawn.c
index d5d6884..9b415b1 100644
--- a/src/pk-spawn.c
+++ b/src/pk-spawn.c
@@ -267,28 +267,22 @@ pk_spawn_kill (PkSpawn *spawn)
 }
 
 /**
- * pk_spawn_command:
+ * pk_spawn_argv:
+ * @argv: Can be generated using g_strsplit (command, " ", 0)
+ * if there are no spaces in the filename
+ *
  **/
 gboolean
-pk_spawn_command (PkSpawn *spawn, const gchar *command)
+pk_spawn_argv (PkSpawn *spawn, gchar **argv)
 {
 	gboolean ret;
-	gchar **argv;
 
 	g_return_val_if_fail (PK_IS_SPAWN (spawn), FALSE);
-	g_return_val_if_fail (command != NULL, FALSE);
-
-	if (command == NULL) {
-		pk_warning ("command NULL");
-		return FALSE;
-	}
+	g_return_val_if_fail (argv != NULL, FALSE);
 
-	pk_debug ("command '%s'", command);
+	pk_debug ("argv[0] '%s'", argv[0]);
 	spawn->priv->finished = FALSE;
 
-	/* split command line */
-	argv = g_strsplit (command, " ", 0);
-
 	/* create spawned object for tracking */
 	ret = g_spawn_async_with_pipes (NULL, argv, NULL,
 				 G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
@@ -297,11 +291,10 @@ pk_spawn_command (PkSpawn *spawn, const gchar *command)
 				 &spawn->priv->stdout_fd,
 				 NULL,
 				 NULL);
-	g_strfreev (argv);
 
 	/* we failed to invoke the helper */
 	if (ret == FALSE) {
-		pk_warning ("failed to spawn '%s'", command);
+		pk_warning ("failed to spawn '%s'", argv[0]);
 		return FALSE;
 	}
 
@@ -490,6 +483,7 @@ libst_spawn (LibSelfTest *test)
 	PkSpawn *spawn = NULL;
 	gboolean ret;
 	gchar *path;
+	gchar **argv;
 
 	if (libst_start (test, "PkSpawn", CLASS_AUTO) == FALSE) {
 		return;
@@ -501,8 +495,9 @@ libst_spawn (LibSelfTest *test)
 	/************************************************************/
 	libst_title (test, "make sure return error for missing file");
 	mexit = BAD_EXIT;
-	path = pk_test_get_data ("pk-spawn-test.sh");
-	ret = pk_spawn_command (spawn, "pk-spawn-test-xxx.sh");
+	argv = g_strsplit ("pk-spawn-test-xxx.sh", " ", 0);
+	ret = pk_spawn_argv (spawn, argv);
+	g_strfreev (argv);
 	if (ret == FALSE) {
 		libst_success (test, "failed to run invalid file");
 	} else {
@@ -520,7 +515,11 @@ libst_spawn (LibSelfTest *test)
 	/************************************************************/
 	libst_title (test, "make sure run correct helper");
 	mexit = -1;
-	ret = pk_spawn_command (spawn, path);
+	path = pk_test_get_data ("pk-spawn-test.sh");
+	argv = g_strsplit (path, " ", 0);
+	ret = pk_spawn_argv (spawn, argv);
+	g_free (path);
+	g_strfreev (argv);
 	if (ret) {
 		libst_success (test, "ran correct file");
 	} else {
@@ -561,7 +560,11 @@ libst_spawn (LibSelfTest *test)
 	/************************************************************/
 	libst_title (test, "make sure run correct helper, and kill it");
 	mexit = BAD_EXIT;
-	ret = pk_spawn_command (spawn, path);
+	path = pk_test_get_data ("pk-spawn-test.sh");
+	argv = g_strsplit (path, " ", 0);
+	ret = pk_spawn_argv (spawn, argv);
+	g_free (path);
+	g_strfreev (argv);
 	if (ret) {
 		libst_success (test, NULL);
 	} else {
@@ -583,13 +586,15 @@ libst_spawn (LibSelfTest *test)
 
 	/* get new object */
 	new_spawn_object (test, &spawn);
-	g_free (path);
 
 	/************************************************************/
 	libst_title (test, "make sure run correct helper, and quit it");
 	mexit = BAD_EXIT;
 	path = pk_test_get_data ("pk-spawn-test-sigquit.sh");
-	ret = pk_spawn_command (spawn, path);
+	argv = g_strsplit (path, " ", 0);
+	ret = pk_spawn_argv (spawn, argv);
+	g_free (path);
+	g_strfreev (argv);
 	if (ret) {
 		libst_success (test, NULL);
 	} else {
@@ -609,12 +614,13 @@ libst_spawn (LibSelfTest *test)
 		libst_failed (test, "finish %i!", mexit);
 	}
 
-	g_free (path);
-
 	/************************************************************/
 	libst_title (test, "run lots of data for profiling");
 	path = pk_test_get_data ("pk-spawn-test-profiling.sh");
-	ret = pk_spawn_command (spawn, path);
+	argv = g_strsplit (path, " ", 0);
+	ret = pk_spawn_argv (spawn, argv);
+	g_free (path);
+	g_strfreev (argv);
 	if (ret) {
 		libst_success (test, NULL);
 	} else {
@@ -622,7 +628,6 @@ libst_spawn (LibSelfTest *test)
 	}
 
 	g_object_unref (spawn);
-	g_free (path);
 
 	libst_end (test);
 }
diff --git a/src/pk-spawn.h b/src/pk-spawn.h
index 830c540..1b20fef 100644
--- a/src/pk-spawn.h
+++ b/src/pk-spawn.h
@@ -51,8 +51,8 @@ typedef struct
 GType		 pk_spawn_get_type		  	(void) G_GNUC_CONST;
 PkSpawn		*pk_spawn_new				(void);
 
-gboolean	 pk_spawn_command			(PkSpawn	*spawn,
-							 const gchar	*command)
+gboolean	 pk_spawn_argv				(PkSpawn	*spawn,
+							 gchar		**argv)
 							 G_GNUC_WARN_UNUSED_RESULT;
 gboolean	 pk_spawn_kill				(PkSpawn	*spawn);
 
commit 05fc6f0d194fec00fc97831370dff5418984874b
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Apr 20 20:00:38 2008 +0100

    correct an error enum when we failed to install a local file. rh#443235

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 57fefe7..12a56f5 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -943,7 +943,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     if len(self.yumbase.tsInfo) > 0:
                         self._runYumTransaction()
                 else:
-                    self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
+                    self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s " % inst_file)
             except yum.Errors.InstallError,e:
                 msgs = ';'.join(e)
                 self.error(ERROR_LOCAL_INSTALL_FAILED, msgs)
commit 46921b8e9224599769005088f1ad42228124d78e
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Fri Apr 18 10:52:23 2008 -0400

    Another attempt at catching local install errors.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 41512ad..57fefe7 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -894,17 +894,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"This package could not be installed as it is already installed")
 
     def _checkForNewer(self,po):
-        try:
-            pkgs = self.yumbase.pkgSack.returnNewestByName(name=po.name)
-            if pkgs:
-                newest = pkgs[0]
-                if newest.EVR > po.EVR:
-                    #TODO Add code to send a message here
-                    self.message(MESSAGE_WARNING,"A newer version of %s is available online." % po.name)
-        except (yum.Errors.RepoError, yum.Errors.PackageSackError):
-            # We might not be able to connect to the internet to get
-            # repository metadata, or the package might not exist.
-            pass
+        pkgs = self.yumbase.pkgSack.returnNewestByName(name=po.name)
+        if pkgs:
+            newest = pkgs[0]
+            if newest.EVR > po.EVR:
+                self.message(MESSAGE_WARNING,"A newer version of %s is available online." % po.name)
 
     def install_file (self, inst_file):
         '''
@@ -922,18 +916,38 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         pkgs_to_inst = []
         self.yumbase.conf.gpgcheck=0
-        txmbr = self.yumbase.installLocal(inst_file)
-        if txmbr:
-            self._checkForNewer(txmbr[0].po)
-            try:
-                # Added the package to the transaction set
+
+        try:
+            txmbr = self.yumbase.installLocal(inst_file)
+            if txmbr:
+                self._checkForNewer(txmbr[0].po)
+            # Added the package to the transaction set
                 if len(self.yumbase.tsInfo) > 0:
                     self._runYumTransaction()
+            else:
+                self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
+
+        except yum.Errors.InstallError,e:
+            msgs = ';'.join(e)
+            self.error(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
+        except (yum.Errors.RepoError, yum.Errors.PackageSackError, IOError):
+            # We might not be able to connect to the internet to get
+            # repository metadata, or the package might not exist.
+            # Try again, (temporarily) disabling repos first.
+            try:
+                for repo in self.yumbase.repos.listEnabled():
+                    repo.disable()
+
+                txmbr = self.yumbase.installLocal(inst_file)
+                if txmbr:
+                    if len(self.yumbase.tsInfo) > 0:
+                        self._runYumTransaction()
+                else:
+                    self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
             except yum.Errors.InstallError,e:
                 msgs = ';'.join(e)
-                self.error(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
-        else:
-            self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
+                self.error(ERROR_LOCAL_INSTALL_FAILED, msgs)
+                
 
     def update(self, packages):
         '''
commit ae32b357ab7511c063f4ef0fff9ffbbaa7484f53
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Apr 17 18:02:37 2008 +0100

    convert the unused metadata signals into status signals. Now we get nice UI feedback

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c01e528..41512ad 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -189,15 +189,12 @@ groupMap = {
 }
 
 MetaDataMap = {
-'repomd.xml'             : "repository",
-'primary.sqlite.bz2'     : "package",
-'primary.xml.gz'         : "package",
-'filelists.sqlite.bz2'   : "filelist",
-'filelists.xml.gz'       : "filelist",
-'other.sqlite.bz2'       : "changelog",
-'other.xml.gz'           : "changelog",
-'comps.xml'              : "group",
-'updateinfo.xml.gz'      : "update"
+    'repomd'        : STATUS_DOWNLOAD_REPOSITORY,
+    'primary'       : STATUS_DOWNLOAD_PACKAGELIST,
+    'filelists'     : STATUS_DOWNLOAD_FILELIST,
+    'other'         : STATUS_DOWNLOAD_CHANGELOG,
+    'comps'         : STATUS_DOWNLOAD_GROUP,
+    'updateinfo'    : STATUS_DOWNLOAD_UPDATEINFO
 }
 
 GUI_KEYS = re.compile(r'(qt)|(gtk)')
@@ -1509,11 +1506,11 @@ class DownloadCallback( BaseMeter ):
                 if pkg: # show package to download
                     self.base._show_package(pkg,INFO_DOWNLOADING)
                 else:
-                    if name in MetaDataMap:
-                        typ = MetaDataMap[name]
-                    else:
-                        typ = 'unknown'
-                    self.base.metadata(typ,name)
+                    for key in MetaDataMap.keys():
+                        if key in name:
+                            typ = MetaDataMap[key]
+                            self.base.status(typ)
+                            break
             self.base.sub_percentage(0)
         else:
             if self.lastPct != pct and pct != 0 and pct != 100:
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 0361626..8a44d47 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -210,12 +210,12 @@ groupMap = {
 }
 
 MetaDataMap = {
-    'repomd'        : "repository",
-    'primary'       : "package",
-    'filelists'     : "filelist",
-    'other'         : "changelog",
-    'comps'         : "group",
-    'updateinfo'    : "update"
+    'repomd'        : STATUS_DOWNLOAD_REPOSITORY,
+    'primary'       : STATUS_DOWNLOAD_PACKAGELIST,
+    'filelists'     : STATUS_DOWNLOAD_FILELIST,
+    'other'         : STATUS_DOWNLOAD_CHANGELOG,
+    'comps'         : STATUS_DOWNLOAD_GROUP,
+    'updateinfo'    : STATUS_DOWNLOAD_UPDATEINFO
 }
 
 GUI_KEYS = re.compile(r'(qt)|(gtk)')
@@ -1968,12 +1968,12 @@ class DownloadCallback( BaseMeter ):
                 if pkg: # show package to download
                     self.base._show_package(pkg,INFO_DOWNLOADING)
                 else:
-                    typ = 'unknown'
+                    typ = STATUS_DOWNLOAD_REPOSITORY
                     for key in MetaDataMap.keys():
                         if key in name:
                             typ = MetaDataMap[key]
                             break
-                    self.base.MetaData(typ,name)
+                    self.base.StatusChanged(typ)
             self.base.SubPercentageChanged(0)
         else:
             if self.lastPct != pct and pct != 0 and pct != 100:
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index b0124c0..92180fe 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -127,15 +127,6 @@ class PackageKitBaseBackend:
         print "data\t%s" % (data)
         sys.stdout.flush()
 
-    def metadata(self,typ,fname):
-        '''
-        send 'metadata' signal:
-        @param type:   The type of metadata (repository,package,filelist,changelog,group,unknown)
-        @param fname:  The filename being downloaded
-        '''
-        print "metadata\t%s\t%s" % (typ,fname)
-        sys.stdout.flush()
-
     def description(self,id,license,group,desc,url,bytes):
         '''
         Send 'description' signal
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 8ff4b52..06b9090 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -295,17 +295,6 @@ class PackageKitBaseBackend(dbus.service.Object):
     @PKSignalHouseKeeper
     @dbus.service.signal(dbus_interface=PACKAGEKIT_DBUS_INTERFACE,
                          signature='ss')
-    def MetaData(self,typ,fname):
-        '''
-        send 'metadata' signal:
-        @param type:   The type of metadata (repository,package,filelist,changelog,group,unknown)
-        @param fname:  The filename being downloaded
-        '''
-        pklog.info("MetaData (%s, %s)" % (typ,fname))
-
-    @PKSignalHouseKeeper
-    @dbus.service.signal(dbus_interface=PACKAGEKIT_DBUS_INTERFACE,
-                         signature='ss')
     def RequireRestart(self,type,details):
         '''
         send 'require-restart' signal:
commit b7b0462cd213be2f3bb4f3a558eec56c4b72e96f
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Thu Apr 17 12:20:02 2008 -0400

    Catch errors when checking for updated packages during install_file method.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index d1d7a65..c01e528 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -897,12 +897,17 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"This package could not be installed as it is already installed")
 
     def _checkForNewer(self,po):
-        pkgs = self.yumbase.pkgSack.returnNewestByName(name=po.name)
-        if pkgs:
-            newest = pkgs[0]
-            if newest.EVR > po.EVR:
-                #TODO Add code to send a message here
-                self.message(MESSAGE_WARNING,"Newer version of %s, exist in the repositories " % po.name)
+        try:
+            pkgs = self.yumbase.pkgSack.returnNewestByName(name=po.name)
+            if pkgs:
+                newest = pkgs[0]
+                if newest.EVR > po.EVR:
+                    #TODO Add code to send a message here
+                    self.message(MESSAGE_WARNING,"A newer version of %s is available online." % po.name)
+        except (yum.Errors.RepoError, yum.Errors.PackageSackError):
+            # We might not be able to connect to the internet to get
+            # repository metadata, or the package might not exist.
+            pass
 
     def install_file (self, inst_file):
         '''
commit 71fce449604ca139beb5e3b0b6f626b9e52ad6da
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Apr 17 14:56:02 2008 +0100

    yum: improve the BASENAME filter by preferably matching against a non -devel and -debuginfo package

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 0fe346b..d1d7a65 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1108,6 +1108,15 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         else:
             return INFO_UNKNOWN
 
+    def _is_main_package(self, repo):
+        if repo.endswith('-debuginfo'):
+            return False
+        if repo.endswith('-devel'):
+            return False
+        if repo.endswith('-libs'):
+            return False
+        return True
+
     def _basename_filter(self, package_list):
         '''
         Filter the list so that the number of packages are reduced.
@@ -1137,7 +1146,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 output_list.append((pkg,status))
                 base_list_already_got.append ((base,version))
 
-        #for all the already added output lists, remove the same basename from base_list
+        #for all the ones not yet got, can we match against a non devel match?
+        for (pkg,status,base,version) in base_list:
+            if (base,version) not in base_list_already_got:
+                if self._is_main_package(pkg.name):
+                    output_list.append((pkg,status))
+                    base_list_already_got.append ((base,version))
+
+        #add the remainder of the packages, which should just be the single debuginfo's
         for (pkg,status,base,version) in base_list:
             if (base,version) not in base_list_already_got:
                 output_list.append((pkg,status))
commit 619875f3fef96e8d776736b64346b426685ef206
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Wed Apr 16 13:07:49 2008 -0400

    Fix some error messages.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 0e1534a..0fe346b 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -232,7 +232,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 try:
                     func(*args, **kwargs)
                 except yum.Errors.RepoError, e:
-                    self.error(ERROR_NO_CACHE,"Package cache is invalid and could not be rebuilt .")
+                    self.error(ERROR_NO_CACHE,"Package cache is invalid and could not be rebuilt.")
 
         return wrapper
 
@@ -1386,9 +1386,10 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         to packagekit.
         Overload this method if you what handle special Tracebacks
         '''
-        if issubclass(tb, (yum.Errors.RepoError, IOError)):
+        if issubclass(tb, yum.Errors.RepoError):
             # Unhandled Repo error, can be network problems
-            self.error(ERROR_REPO_NOT_AVAILABLE, "Problem connecting to repository, this can be caused by network problems or a misconfigured repository")
+            
+            self.error(ERROR_REPO_NOT_AVAILABLE, "Problem connecting to software source.  This can be caused by network problems or a misconfiguration.")
             return True
         else: # Do the default stuff
             return False
commit 14ea7c67fce961955ac665a3a87122064f81d4bb
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Apr 17 17:06:49 2008 +0100

    wait for network to come back up before refreshing after a suspend. fixes rh#442166

diff --git a/src/pk-engine.c b/src/pk-engine.c
index fff703f..07a3d31 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -75,9 +75,9 @@ static void     pk_engine_finalize	(GObject       *object);
  *
  * We probably also need to wait for NetworkManager to come back up if we are
  * resuming, and we probably don't want to be doing this at a busy time after
- * a yum tramsaction.
+ * a yum transaction.
  */
-#define PK_ENGINE_STATE_CHANGED_TIMEOUT		5 /* seconds */
+#define PK_ENGINE_STATE_CHANGED_TIMEOUT		10 /* seconds */
 
 struct PkEnginePrivate
 {
@@ -2657,10 +2657,18 @@ pk_engine_cancel (PkEngine *engine, const gchar *tid, GError **error)
 static gboolean
 pk_engine_state_changed_cb (gpointer data)
 {
+	gboolean ret;
 	PkEngine *engine = PK_ENGINE (data);
 
 	g_return_val_if_fail (PK_IS_ENGINE (engine), FALSE);
 
+	/* if NetworkManager is not up, then just reschedule */
+	ret = pk_network_is_online (engine->priv->network);
+	if (!ret) {
+		/* wait another timeout of PK_ENGINE_STATE_CHANGED_TIMEOUT */
+		return TRUE;
+	}
+
 	if (engine->priv->updates_cache != NULL) {
 		pk_debug ("unreffing updates cache as state may have changed");
 		g_object_unref (engine->priv->updates_cache);
commit 52640b0b9a7bfb321856358e71d301bcc3f16f4d
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 15 16:57:40 2008 -0400

    Change from network error to repo error when we cannot connect to a repository.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 750430d..0e1534a 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1388,7 +1388,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         '''
         if issubclass(tb, (yum.Errors.RepoError, IOError)):
             # Unhandled Repo error, can be network problems
-            self.error(ERROR_NO_NETWORK,"Problem with loading repository metadata, this can be caused by network problems or repository misconfigurations")
+            self.error(ERROR_REPO_NOT_AVAILABLE, "Problem connecting to repository, this can be caused by network problems or a misconfigured repository")
             return True
         else: # Do the default stuff
             return False
diff --git a/docs/spec/pk-concepts.xml b/docs/spec/pk-concepts.xml
index 7703c92..11c687b 100644
--- a/docs/spec/pk-concepts.xml
+++ b/docs/spec/pk-concepts.xml
@@ -297,6 +297,13 @@
             <entry><literal>repo-configuration-error</literal></entry>
             <entry>One of the enabled repositories has invalid configuration</entry>
           </row>
+	  <row>
+	    <entry><literal>repo-not-available</literal></entry>
+	    <entry>
+	      There was a (possibly transient) problem connecting to a
+	      repository
+	    </entry>
+	  </row>
           <row>
             <entry><literal>cannot-remove-system-package</literal></entry>
             <entry>
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 124df4d..e770d8d 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -136,6 +136,7 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
 	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
 	{PK_ERROR_ENUM_FILE_CONFLICTS,		"file-conflicts"},
+	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,      "repo-not-available"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 3440dd5..7773f14 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -220,6 +220,7 @@ typedef enum {
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
 	PK_ERROR_ENUM_FILE_CONFLICTS,
+	PK_ERROR_ENUM_REPO_NOT_AVAILABLE,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 
commit cf81c3b2669f8509a5edf560151def604945d999
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 20:23:42 2008 +0100

    merge Robin Norwood's changes in 12cc5abc950af7cc0079a729b5bf317981db50bb with a sync with yumBackend.py from master. Fixes rh#439735

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 598ab38..750430d 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -220,6 +220,22 @@ class PackageKitYumBackend(PackageKitBaseBackend):
               "kernel-xen0", "kernel-xenU", "kernel-xen", "kernel-xen-guest",
               "glibc", "hal", "dbus", "xen")
 
+    def handle_repo_error(func):
+        def wrapper(*args, **kwargs):
+            self = args[0]
+
+            try:
+                func(*args, **kwargs)
+            except yum.Errors.RepoError,e:
+                self._refresh_yum_cache()
+
+                try:
+                    func(*args, **kwargs)
+                except yum.Errors.RepoError, e:
+                    self.error(ERROR_NO_CACHE,"Package cache is invalid and could not be rebuilt .")
+
+        return wrapper
+
     def __init__(self,args,lock=True):
         signal.signal(signal.SIGQUIT, sigquit)
         PackageKitBaseBackend.__init__(self,args)
@@ -271,7 +287,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 time.sleep(2)
                 retries += 1
                 if retries > 100:
-                    self.error(ERROR_INTERNAL_ERROR,'Yum is locked by another application')
+                    self.error(ERROR_CANNOT_GET_LOCK,'Yum is locked by another application')
 
     def unLock(self):
         ''' Unlock Yum'''
@@ -292,6 +308,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         ''' gets the NEVRA for a pkg '''
         return "%s-%s:%s-%s.%s" % (pkg.name,pkg.epoch,pkg.version,pkg.release,pkg.arch);
 
+    @handle_repo_error
     def _do_search(self,searchlist,filters,key):
         '''
         Search for yum packages
@@ -299,30 +316,24 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         @param filters: package types to search (all,installed,available)
         @param key: key to seach for
         '''
-        self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
-        try:
-            res = self.yumbase.searchGenerator(searchlist, [key])
-            fltlist = filters.split(';')
-            installed_nevra = [] # yum returns packages as available even when installed
-            pkg_list = [] # only do the second iteration on not installed pkgs
-            package_list = [] #we can't do emitting as found if we are post-processing
-
-            for (pkg,values) in res:
-                if pkg.repo.id == 'installed':
-                    if self._do_extra_filtering(pkg,fltlist):
-                        package_list.append((pkg,INFO_INSTALLED))
-                        installed_nevra.append(self._get_nevra(pkg))
-                else:
-                    pkg_list.append(pkg)
-            for pkg in pkg_list:
-                nevra = self._get_nevra(pkg)
-                if nevra not in installed_nevra:
-                    if self._do_extra_filtering(pkg,fltlist):
-                        package_list.append((pkg,INFO_AVAILABLE))
+        res = self.yumbase.searchGenerator(searchlist, [key])
+        fltlist = filters.split(';')
+        installed_nevra = [] # yum returns packages as available even when installed
+        pkg_list = [] # only do the second iteration on not installed pkgs
+        package_list = [] #we can't do emitting as found if we are post-processing
 
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
+        for (pkg,values) in res:
+            if pkg.repo.id == 'installed':
+                if self._do_extra_filtering(pkg,fltlist):
+                    package_list.append((pkg,INFO_INSTALLED))
+                    installed_nevra.append(self._get_nevra(pkg))
+            else:
+                pkg_list.append(pkg)
+        for pkg in pkg_list:
+            nevra = self._get_nevra(pkg)
+            if nevra not in installed_nevra:
+                if self._do_extra_filtering(pkg,fltlist):
+                    package_list.append((pkg,INFO_AVAILABLE))
 
         # basename filter if specified
         if FILTER_BASENAME in fltlist:
@@ -369,15 +380,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     def _check_for_gui(self,pkg):
         '''  Check if the GUI_KEYS regex matches any package requirements'''
-        try:
-            for req in pkg.requires:
-                reqname = req[0]
-                if GUI_KEYS.search(reqname):
-                    return True
-            return False
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
+        for req in pkg.requires:
+            reqname = req[0]
+            if GUI_KEYS.search(reqname):
+                return True
+        return False
 
     def _do_devel_filtering(self,flt,pkg):
         isDevel = False
@@ -411,7 +418,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         searchlist = ['name']
         self.status(STATUS_QUERY)
-        self._do_search(searchlist, filters, key)
+        self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
+
+        try:
+            self._do_search(searchlist, filters, key)
+        except RefreshYumCacheFailed, e:
+            return
 
     def search_details(self,filters,key):
         '''
@@ -423,7 +435,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         searchlist = ['name', 'summary', 'description', 'group']
         self.status(STATUS_QUERY)
-        self._do_search(searchlist, filters, key)
+
+        try:
+            self._do_search(searchlist, filters, key)
+        except RefreshYumCacheFailed, e:
+            return
 
     def _buildGroupDict(self):
         pkgGroups= {}
@@ -443,6 +459,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     pkgGroups[pkg] = "%s;%s" % (cat.categoryid,group.groupid)
         return pkgGroups
 
+    @handle_repo_error
     def search_group(self,filters,key):
         '''
         Implement the {backend}-search-group functionality
@@ -490,48 +507,52 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         except yum.Errors.GroupsError,e:
             self.error(ERROR_GROUP_NOT_FOUND,e)
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
 
-    def get_packages(self,filters,showdesc='no'):
+        # basename filter if specified
+        if FILTER_BASENAME in fltlist:
+            for (pkg,status) in self._basename_filter(package_list):
+                self._show_package(pkg,status)
+        else:
+            for (pkg,status) in package_list:
+                self._show_package(pkg,status)
+
+    @handle_repo_error
+    def get_packages(self,filters):
         '''
         Search for yum packages
         @param searchlist: The yum package fields to search in
         @param filters: package types to search (all,installed,available)
         @param key: key to seach for
         '''
+        self.status(STATUS_QUERY)
+        self.allow_cancel(True)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
         self.yumbase.conf.cache = 1 # Only look in cache.
-        showDesc = (showdesc == 'yes' or showdesc == 'only' )
-        showPkg = (showdesc != 'only')
-        print showDesc,showPkg
-        try:
-            fltlist = filters.split(';')
-            available = []
-            count = 1
-            if FILTER_NOT_INSTALLED not in fltlist:
-                for pkg in self.yumbase.rpmdb:
-                    if self._do_extra_filtering(pkg,fltlist):
-                        if showPkg:
-                            self._show_package(pkg, INFO_INSTALLED)
-                        if showDesc:
-                            self._show_description(pkg)
-                        
+
+        package_list = [] #we can't do emitting as found if we are post-processing
+        fltlist = filters.split(';')
+
+        # Now show installed packages.
+        if FILTER_NOT_INSTALLED not in fltlist:
+            for pkg in self.yumbase.rpmdb:
+                if self._do_extra_filtering(pkg,fltlist):
+                    package_list.append((pkg,INFO_INSTALLED))
 
         # Now show available packages.
-            if FILTER_INSTALLED not in fltlist:
-                for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
-                    if self._do_extra_filtering(pkg,fltlist):
-                        if showPkg:
-                            self._show_package(pkg, INFO_AVAILABLE)
-                        if showDesc:
-                            self._show_description(pkg)
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
+        if FILTER_INSTALLED not in fltlist:
+            for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
+                if self._do_extra_filtering(pkg,fltlist):
+                    package_list.append((pkg,INFO_AVAILABLE))
 
-    
+        # basename filter if specified
+        if FILTER_BASENAME in fltlist:
+            for (pkg,status) in self._basename_filter(package_list):
+                self._show_package(pkg,status)
+        else:
+            for (pkg,status) in package_list:
+                self._show_package(pkg,status)
+
+    @handle_repo_error
     def search_file(self,filters,key):
         '''
         Implement the {backend}-search-file functionality
@@ -562,6 +583,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                         self._show_package(pkg, INFO_AVAILABLE)
                         found[str(pkg)] = 1
 
+    @handle_repo_error
     def what_provides(self, filters, provides_type, search):
         '''
         Implement the {backend}-what-provides functionality
@@ -611,11 +633,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         if len(id.split(';')) > 1:
             # Split up the id
             (n,idver,a,d) = self.get_package_from_id(id)
-            # get e,v,r from package id version 
+            # get e,v,r from package id version
             e,v,r = self._getEVR(idver)
         else:
             n = id
-            e = v = r = a = None  
+            e = v = r = a = None
         # search the rpmdb for the nevra
         pkgs = self.yumbase.rpmdb.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
         # if the package is found, then return it
@@ -631,17 +653,13 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     def _get_pkg_requirements(self,pkg,reqlist=[] ):
         pkgs = self.yumbase.rpmdb.searchRequires(pkg.name)
-        print 
         reqlist.extend(pkgs)
-        print "DEBUG: ", reqlist
         if pkgs:
             for po in pkgs:
                 self._get_pkg_requirements(po,reqlist)
         else:
             return reqlist
-        
-        
-            
+
     def get_requires(self,filters,package,recursive):
         '''
         Print a list of requires for a given package
@@ -765,7 +783,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 if self._is_inst(pkg) and FILTER_NOT_INSTALLED not in fltlist:
                     self.package(id, INFO_INSTALLED, pkg.summary)
                 else:
-                    if self._installable(pkg) and FILTER_NOT_INSTALLED not in fltlist:
+                    if self._installable(pkg) and FILTER_INSTALLED not in fltlist:
                         self.package(id, INFO_AVAILABLE, pkg.summary)
 
     def update_system(self):
@@ -773,7 +791,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         Implement the {backend}-update-system functionality
         '''
         self._check_init(lazy_cache=True)
-        self.allow_cancel(False)
+        self.allow_cancel(True)
         self.percentage(0)
         self.status(STATUS_RUNNING)
 
@@ -785,7 +803,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         if txmbr:
             self._runYumTransaction()
         else:
-            self.error(ERROR_INTERNAL_ERROR,"Nothing to do")
+            self.error(ERROR_NO_PACKAGES_TO_UPDATE,"Nothing to do")
 
         self.yumbase.conf.throttle = old_throttle
 
@@ -824,15 +842,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         except yum.Errors.RepoError, e:
             self.error(ERROR_REPO_CONFIGURATION_ERROR, str(e))
         except yum.Errors.YumBaseError, e:
-            self.error(ERROR_INTERNAL_ERROR,str(e))
+            self.error(ERROR_UNKNOWN,str(e))
 
+    @handle_repo_error
     def resolve(self, filters, name):
         '''
         Implement the {backend}-resolve functionality
         '''
-        print >> sys.stderr, "start init"
         self._check_init(lazy_cache=True)
-        print >> sys.stderr, "end init"
         self.allow_cancel(True);
         self.percentage(None)
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
@@ -840,28 +857,25 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.status(STATUS_QUERY)
 
         fltlist = filters.split(';')
-        try:
-            # Get installed packages
-            installedByKey = self.yumbase.rpmdb.searchNevra(name=name)
-            if FILTER_NOT_INSTALLED not in fltlist:
-                for pkg in installedByKey:
-                    self._show_package(pkg,INFO_INSTALLED)
-            # Get available packages
-            if FILTER_INSTALLED not in fltlist:
-                for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
-                    if pkg.name == name:
-                        show = True
-                        for instpo in installedByKey:
-                            # Check if package have a smaller & equal EVR to a inst pkg
-                            if pkg.EVR < instpo.EVR or pkg.EVR == instpo.EVR:
-                                show = False
-                        if show:
-                            self._show_package(pkg,INFO_AVAILABLE)
-                            break
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
-            
+        # Get installed packages
+        installedByKey = self.yumbase.rpmdb.searchNevra(name=name)
+        if FILTER_NOT_INSTALLED not in fltlist:
+            for pkg in installedByKey:
+                self._show_package(pkg,INFO_INSTALLED)
+        # Get available packages
+        if FILTER_INSTALLED not in fltlist:
+            for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
+                if pkg.name == name:
+                    show = True
+                    for instpo in installedByKey:
+                        # Check if package have a smaller & equal EVR to a inst pkg
+                        if pkg.EVR < instpo.EVR or pkg.EVR == instpo.EVR:
+                            show = False
+                    if show:
+                        self._show_package(pkg,INFO_AVAILABLE)
+                        break
+
+    @handle_repo_error
     def install(self, packages):
         '''
         Implement the {backend}-install functionality
@@ -890,8 +904,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 #TODO Add code to send a message here
                 self.message(MESSAGE_WARNING,"Newer version of %s, exist in the repositories " % po.name)
 
-
-
     def install_file (self, inst_file):
         '''
         Implement the {backend}-install_file functionality
@@ -920,7 +932,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 self.error(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
         else:
             self.error(ERROR_PACKAGE_ALREADY_INSTALLED,"Can't install %s " % inst_file)
-            
 
     def update(self, packages):
         '''
@@ -956,7 +967,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 break
 
     def _format_msgs(self,msgs):
-        if isinstance(msgs, basestring):        
+        if isinstance(msgs, basestring):
             msgs = msgs.split('\n')
         return ";".join(msgs)
 
@@ -987,20 +998,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 self.error(ERROR_PACKAGE_DOWNLOAD_FAILED,retmsg)
             except yum.Errors.YumGPGCheckError, ye:
                 retmsg = "Error in Package Signatures;" + self._format_msgs(ye.value)
-                self.error(ERROR_INTERNAL_ERROR,retmsg)
+                self.error(ERROR_BAD_GPG_SIGNATURE,retmsg)
             except GPGKeyNotImported, e:
                 keyData = self.yumbase.missingGPGKey
-                print "debug :",keyData
                 if not keyData:
-                    self.error(ERROR_INTERNAL_ERROR,
+                    self.error(ERROR_BAD_GPG_SIGNATURE,
                                "GPG key not imported, and no GPG information was found.")
 
-# We need a yum with this change:
-# http://devel.linux.duke.edu/gitweb/?p=yum.git;a=commit;h=09640c743fb6a7ade5711183dc7d5964e1bd3221
-# to have fingerprint and timestamp available here
-# the above change is now in the latest yum for Fedor arawhide (yum-3.2.6-5.fc8)
                 id = self._pkg_to_id(keyData['po'])
-                print id
                 self.repo_signature_required(id,
                                              keyData['po'].repoid,
                                              keyData['keyurl'],
@@ -1009,7 +1014,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                                              keyData['fingerprint'],
                                              keyData['timestamp'],
                                              'GPG')
-                print "post"                                             
                 self.error(ERROR_GPG_FAILURE,"GPG key not imported.")
             except yum.Errors.YumBaseError, ye:
                 message = self._format_msgs(ye.value)
@@ -1054,9 +1058,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         if pkg:
             self._show_description(pkg)
         else:
-            self.error(ERROR_INTERNAL_ERROR,'Package was not found')
+            self.error(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
 
-    def _show_description(self,pkg):        
+    def _show_description(self,pkg):
         pkgver = self._get_package_ver(pkg)
         id = self.get_package_id(pkg.name, pkgver, pkg.arch, pkg.repo)
         desc = pkg.description
@@ -1081,7 +1085,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
             self.files(package, file_list)
         else:
-            self.error(ERROR_INTERNAL_ERROR,'Package was not found')
+            self.error(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
 
     def _pkg_to_id(self,pkg):
         pkgver = self._get_package_ver(pkg)
@@ -1153,21 +1157,17 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         fltlist = filters.split(';')
         package_list = []
 
-        try:
-            ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
-            md = self.updateMetadata
-            for pkg in ygl.updates:
-                if self._do_extra_filtering(pkg, fltlist):
-                    # Get info about package in updates info
-                    notice = md.get_notice((pkg.name, pkg.version, pkg.release))
-                    if notice:
-                        status = self._get_status(notice)
-                        package_list.append((pkg,status))
-                    else:
-                        package_list.append((pkg,INFO_NORMAL))
-        except yum.Errors.RepoError,e:
-            self._refresh_yum_cache()
-            self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
+        ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
+        md = self.updateMetadata
+        for pkg in ygl.updates:
+            if self._do_extra_filtering(pkg, fltlist):
+                # Get info about package in updates info
+                notice = md.get_notice((pkg.name, pkg.version, pkg.release))
+                if notice:
+                    status = self._get_status(notice)
+                    package_list.append((pkg,status))
+                else:
+                    package_list.append((pkg,INFO_NORMAL))
 
         # basename filter if specified
         if FILTER_BASENAME in fltlist:
@@ -1195,17 +1195,32 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         except yum.Errors.RepoError,e:
             self.error(ERROR_REPO_NOT_FOUND, "repo %s is not found" % repoid)
 
+    def _is_development_repo(self, repo):
+        if repo.endswith('-debuginfo'):
+            return True
+        if repo.endswith('-testing'):
+            return True
+        if repo.endswith('-debug'):
+            return True
+        if repo.endswith('-development'):
+            return True
+        if repo.endswith('-source'):
+            return True
+        return False
+
     def get_repo_list(self, filters):
         '''
         Implement the {backend}-get-repo-list functionality
         '''
         self._check_init()
         self.status(STATUS_INFO)
+
         for repo in self.yumbase.repos.repos.values():
-            if repo.isEnabled():
-                self.repo_detail(repo.id,repo.name,'true')
-            else:
-                self.repo_detail(repo.id,repo.name,'false')
+            if filters != FILTER_NOT_DEVELOPMENT or not self._is_development_repo(repo.id):
+                if repo.isEnabled():
+                    self.repo_detail(repo.id,repo.name,'true')
+                else:
+                    self.repo_detail(repo.id,repo.name,'false')
 
     def _get_obsoleted(self,name):
         obsoletes = self.yumbase.up.getObsoletesTuples( newest=1 )
@@ -1235,7 +1250,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     _updateMetadata = None
     updateMetadata = property(fget=_get_update_metadata)
-    
+
     def _format_str(self,str):
         """
         Convert a multi line string to a list separated by ';'
@@ -1275,7 +1290,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 urls[typ].append("%s;%s" % (href,title))
             else:
                 urls['vendor'].append("%s;%s" % (ref['href'],ref['title']))
-                        
+
             # Reboot flag
             if notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']:
                 reboot = 'system'
@@ -1314,7 +1329,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             try:
                 repo.cfg.write(file(repo.repofile, 'w'))
             except IOError, e:
-                self.error(ERROR_INTERNAL_ERROR,str(e))
+                self.error(ERROR_CANNOT_WRITE_REPO_CONFIG,str(e))
         else:
             self.error(ERROR_REPO_NOT_FOUND,'repo %s not found' % repoid)
 
@@ -1328,9 +1343,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             try:
                 self.yumbase.getKeyForPackage(pkg, askcb = lambda x, y, z: True)
             except yum.Errors.YumBaseError, e:
-                self.error(ERROR_INTERNAL_ERROR,str(e))
+                self.error(ERROR_UNKNOWN,str(e))
             except:
-                self.error(ERROR_INTERNAL_ERROR,"Error importing GPG Key for %s" % pkg)
+                self.error(ERROR_GPG_FAILURE,"Error importing GPG Key for %s" % pkg)
 
     def _check_init(self,lazy_cache=False):
         '''Just does the caching tweaks'''
@@ -1397,7 +1412,7 @@ class DownloadCallback( BaseMeter ):
         self.numPkgs = float(len(self.pkgs))
         self.bump = numPct/self.numPkgs
         self.totalPct = startPct
-        
+
     def _getPackage(self,name):
         if self.pkgs:
             for pkg in self.pkgs:
@@ -1477,7 +1492,7 @@ class DownloadCallback( BaseMeter ):
                     else:
                         typ = 'unknown'
                     self.base.metadata(typ,name)
-            self.base.sub_percentage(0)        
+            self.base.sub_percentage(0)
         else:
             if self.lastPct != pct and pct != 0 and pct != 100:
                 self.lastPct = pct
@@ -1564,7 +1579,6 @@ class ProcessTransPackageKitCallback:
             self.base.percentage(50)
             pass
 
-
 class DepSolveCallback(object):
 
     # XXX takes a PackageKitBackend so we can call StatusChanged on it.
@@ -1585,7 +1599,6 @@ class DepSolveCallback(object):
     def __getattr__(self, x):
         return self._do_nothing
 
-
 class PackageKitYumBase(yum.YumBase):
     """
     Subclass of YumBase.  Needed so we can overload _checkSignatures
commit fb3d380d4725f50e6d040c6eba43d3f1d66aa0ae
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 15 14:34:57 2008 -0400

    Set default throttle to 90%

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c3301b1..598ab38 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -777,12 +777,18 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.percentage(0)
         self.status(STATUS_RUNNING)
 
+        old_throttle = self.yumbase.conf.throttle
+        self.yumbase.conf.throttle = "60%" # Set bandwidth throttle to 60%
+                                           # to avoid taking all the system's bandwidth.
+
         txmbr = self.yumbase.update() # Add all updates to Transaction
         if txmbr:
             self._runYumTransaction()
         else:
             self.error(ERROR_INTERNAL_ERROR,"Nothing to do")
 
+        self.yumbase.conf.throttle = old_throttle
+
     def refresh_cache(self):
         '''
         Implement the {backend}-refresh_cache functionality
@@ -1352,7 +1358,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
     def _setup_yum(self):
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)     # Setup Yum Config
-        self.yumbase.conf.throttle = "40%"                        # Set bandwidth throttle to 40%
+        self.yumbase.conf.throttle = "90%"                        # Set bandwidth throttle to 40%
         self.dnlCallback = DownloadCallback(self,showNames=True)  # Download callback
         self.yumbase.repos.setProgressBar( self.dnlCallback )     # Setup the download callback class
 
commit a7f965716cf5edde5e80b0fbb47074f92f862d03
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Wed Apr 9 14:39:43 2008 -0400

    Add 'zlib with acknowledgement' license tag.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 52ff228..124df4d 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -364,6 +364,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_ZPLV2_DOT_0,          "ZPLv2.0"},
 	{PK_LICENSE_ENUM_ZPLV2_DOT_1,          "ZPLv2.1"},
 	{PK_LICENSE_ENUM_ZLIB,                 "zlib"},
+	{PK_LICENSE_ENUM_ZLIB_WITH_ACK,        "zlib with acknowledgement"},
 	{PK_LICENSE_ENUM_CDL,                  "CDL"},
 	{PK_LICENSE_ENUM_FBSDDL,               "FBSDDL"},
 	{PK_LICENSE_ENUM_GFDL,                 "GFDL"},
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index c7667f2..3440dd5 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -433,6 +433,7 @@ typedef enum {
 	PK_LICENSE_ENUM_ZPLV2_DOT_0,
 	PK_LICENSE_ENUM_ZPLV2_DOT_1,
 	PK_LICENSE_ENUM_ZLIB,
+	PK_LICENSE_ENUM_ZLIB_WITH_ACK,
 	PK_LICENSE_ENUM_CDL,
 	PK_LICENSE_ENUM_FBSDDL,
 	PK_LICENSE_ENUM_GFDL,
commit b087919bddb14e7f612857bbcc7f437afb4074d5
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 16:27:40 2008 +0100

    emit a custom error when there is a file conflict

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index b8e8ed7..c3301b1 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1006,8 +1006,11 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 print "post"                                             
                 self.error(ERROR_GPG_FAILURE,"GPG key not imported.")
             except yum.Errors.YumBaseError, ye:
-                retmsg = "Error in Transaction Processing;" + self._format_msgs(ye.value)
-                self.error(ERROR_TRANSACTION_ERROR,retmsg)
+                message = self._format_msgs(ye.value)
+                if message.find ("conflicts with file") != -1:
+                    self.error(ERROR_FILE_CONFLICTS,message)
+                else:
+                    self.error(ERROR_TRANSACTION_ERROR,message)
 
     def remove(self, allowdep, package):
         '''
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index cdeb816..52ff228 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -135,6 +135,7 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
 	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
 	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
+	{PK_ERROR_ENUM_FILE_CONFLICTS,		"file-conflicts"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 1f2b475..c7667f2 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -219,6 +219,7 @@ typedef enum {
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
+	PK_ERROR_ENUM_FILE_CONFLICTS,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 
commit e47ef2a1f21db964260ff6a1ba2cf846faa5d127
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 18:27:45 2008 +0100

    add the PK_ERROR_ENUM_NO_LICENSE_AGREEMENT so we can apply other patches

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 584f700..cdeb816 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -134,6 +134,7 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,       "bad-gpg-signature"},
 	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
 	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
+	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 9b648a7..1f2b475 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -218,6 +218,7 @@ typedef enum {
 	PK_ERROR_ENUM_BAD_GPG_SIGNATURE,
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
+	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 
commit 95f9f79a360ae82697a4ac0275a7a033087b3751
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Apr 14 11:21:25 2008 -0400

    Fix enum names.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 08a18bd..584f700 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -130,8 +130,8 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_CANNOT_GET_LOCK,         "cannot-get-lock"},
 	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,   "no-packages-to-update"},
 	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,        "cannot-write-repo-config"},
-	{PK_ERROR_LOCAL_INSTALL_FAILED,         "local-install-failed"},
-	{PK_ERROR_BAD_GPG_SIGNATURE,            "bad-gpg-signature"},
+	{PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,    "local-install-failed"},
+	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,       "bad-gpg-signature"},
 	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
 	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
 	{0, NULL}
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index b8684a0..9b648a7 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -214,8 +214,8 @@ typedef enum {
 	PK_ERROR_ENUM_CANNOT_GET_LOCK,
 	PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,
 	PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,
-	PK_ERROR_LOCAL_INSTALL_FAILED,
-	PK_ERROR_BAD_GPG_SIGNATURE,
+	PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,
+	PK_ERROR_ENUM_BAD_GPG_SIGNATURE,
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_UNKNOWN
commit 65215321adf85f3f235000b57a3ea10bef175cbd
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Apr 14 11:15:42 2008 -0400

    Add repo configuration error enum.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 03961b3..b8e8ed7 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -815,6 +815,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             #we might have a rounding error
             self.percentage(100)
 
+        except yum.Errors.RepoError, e:
+            self.error(ERROR_REPO_CONFIGURATION_ERROR, str(e))
         except yum.Errors.YumBaseError, e:
             self.error(ERROR_INTERNAL_ERROR,str(e))
 
diff --git a/docs/spec/pk-concepts.xml b/docs/spec/pk-concepts.xml
index 6ee73f7..7703c92 100644
--- a/docs/spec/pk-concepts.xml
+++ b/docs/spec/pk-concepts.xml
@@ -294,6 +294,10 @@
             <entry>The repository name could not be found</entry>
           </row>
           <row>
+            <entry><literal>repo-configuration-error</literal></entry>
+            <entry>One of the enabled repositories has invalid configuration</entry>
+          </row>
+          <row>
             <entry><literal>cannot-remove-system-package</literal></entry>
             <entry>
               Could not remove a protected system package that is needed for
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index ccee727..08a18bd 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -132,7 +132,8 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,        "cannot-write-repo-config"},
 	{PK_ERROR_LOCAL_INSTALL_FAILED,         "local-install-failed"},
 	{PK_ERROR_BAD_GPG_SIGNATURE,            "bad-gpg-signature"},
-	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,       "cannot-install-source-package"},
+	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
+	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 4e84da6..b8684a0 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -217,6 +217,7 @@ typedef enum {
 	PK_ERROR_LOCAL_INSTALL_FAILED,
 	PK_ERROR_BAD_GPG_SIGNATURE,
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
+	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_UNKNOWN
 } PkErrorCodeEnum;
 
commit 00271c772e1e2e94b2c114012d6da9b0109be7d9
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Apr 14 12:42:41 2008 -0400

    Add VOSTROM public license.

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index e9517de..ccee727 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -381,6 +381,7 @@ static PkEnumMatch enum_free_licenses[] = {
 	{PK_LICENSE_ENUM_MPLUS,                "mplus"},
 	{PK_LICENSE_ENUM_STIX,                 "STIX"},
 	{PK_LICENSE_ENUM_XANO,                 "XANO"},
+	{PK_LICENSE_ENUM_VOSTROM,              "VOSTROM"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index dc90d6e..4e84da6 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -450,6 +450,7 @@ typedef enum {
 	PK_LICENSE_ENUM_MPLUS,
 	PK_LICENSE_ENUM_STIX,
 	PK_LICENSE_ENUM_XANO,
+	PK_LICENSE_ENUM_VOSTROM,
 	PK_LICENSE_ENUM_UNKNOWN
 } PkLicenseEnum;
 
commit 9ea52a0273f17fd81776c07b0e0edcfc6a39fe9f
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 18:12:01 2008 +0100

    correct the vendor_urls for the methods to match master

diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in
index ceaa10c..0de231a 100644
--- a/policy/org.freedesktop.packagekit.policy.in
+++ b/policy/org.freedesktop.packagekit.policy.in
@@ -17,7 +17,7 @@
     <_description>Install package</_description>
     <_message>System policy prevents installing package</_message>
     <icon_name>pk-package-add</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-install-package</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-package</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -28,7 +28,7 @@
     <_description>Install local file</_description>
     <_message>System policy prevents installing file</_message>
     <icon_name>pk-package-add</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-install-file</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-file</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin</allow_active>
@@ -50,7 +50,7 @@
     <_description>Update package</_description>
     <_message>System policy prevents updating package</_message>
     <icon_name>pk-package-update</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-update</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-update</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -61,7 +61,7 @@
     <_description>Remove package</_description>
     <_message>System policy prevents removing package</_message>
     <icon_name>pk-package-delete</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-remove</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-remove</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -72,7 +72,7 @@
     <_description>Update all packages on system</_description>
     <_message>System policy prevents updating system</_message>
     <icon_name>pk-package-update</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-update-system</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-update-system</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -83,7 +83,7 @@
     <_description>Rollback to a previous transaction</_description>
     <_message>System policy prevents rollback</_message>
     <icon_name>pk-rollback</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-rollback</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-rollback</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -94,7 +94,7 @@
     <_description>Change repository parameters</_description>
     <_message>System policy prevents changing repository parameters</_message>
     <icon_name>pk-package-info</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-repo-enable</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-repo-enable</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>auth_admin_keep_always</allow_active>
@@ -105,7 +105,7 @@
     <_description>Refresh package cache</_description>
     <_message>System policy prevents refresh package cache</_message>
     <icon_name>pk-refresh-cache</icon_name>
-    <vendor_url>http://www.packagekit.org/pk-reference.html#api-refresh-cache</vendor_url>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-refresh-cache</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
       <allow_active>yes</allow_active>
commit 990384b7271ea866182cb76c7dba14d7b411e6d3
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 00:02:05 2008 +0100

    don't allow org.freedesktop.packagekit.install-file to be retained

diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in
index da10422..ceaa10c 100644
--- a/policy/org.freedesktop.packagekit.policy.in
+++ b/policy/org.freedesktop.packagekit.policy.in
@@ -35,6 +35,17 @@
     </defaults>
   </action>
 
+  <action id="org.freedesktop.packagekit.install-signature">
+    <_description>Install security signature</_description>
+    <_message>System policy prevents installing security signature</_message>
+    <icon_name>pk-package-add</icon_name>
+    <vendor_url>http://www.packagekit.org/pk-reference.html#methods-install-signature</vendor_url>
+    <defaults>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin</allow_active>
+    </defaults>
+  </action>
+
   <action id="org.freedesktop.packagekit.update-package">
     <_description>Update package</_description>
     <_message>System policy prevents updating package</_message>
commit e72c3c6de4019ca6d4e68e947fadfb8ead8445f3
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 15 15:04:42 2008 +0100

    yum: fix basename sorting so that we still show packages even if they do not produce a rpm as the same name as the srpm. fixes rh#442302

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index b1666dd..03961b3 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -305,11 +305,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             fltlist = filters.split(';')
             installed_nevra = [] # yum returns packages as available even when installed
             pkg_list = [] # only do the second iteration on not installed pkgs
+            package_list = [] #we can't do emitting as found if we are post-processing
 
             for (pkg,values) in res:
                 if pkg.repo.id == 'installed':
                     if self._do_extra_filtering(pkg,fltlist):
-                        self._show_package(pkg, INFO_INSTALLED)
+                        package_list.append((pkg,INFO_INSTALLED))
                         installed_nevra.append(self._get_nevra(pkg))
                 else:
                     pkg_list.append(pkg)
@@ -317,12 +318,20 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 nevra = self._get_nevra(pkg)
                 if nevra not in installed_nevra:
                     if self._do_extra_filtering(pkg,fltlist):
-                        self._show_package(pkg, INFO_AVAILABLE)
+                        package_list.append((pkg,INFO_AVAILABLE))
 
         except yum.Errors.RepoError,e:
             self._refresh_yum_cache()
             self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
 
+        # basename filter if specified
+        if FILTER_BASENAME in fltlist:
+            for (pkg,status) in self._basename_filter(package_list):
+                self._show_package(pkg,status)
+        else:
+            for (pkg,status) in package_list:
+                self._show_package(pkg,status)
+
     def _do_extra_filtering(self,pkg,filterList):
         ''' do extra filtering (gui,devel etc) '''
         for filter in filterList:
@@ -338,9 +347,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             elif filter in (FILTER_FREE, FILTER_NOT_FREE):
                 if not self._do_free_filtering(filter, pkg):
                     return False
-            elif filter in (FILTER_BASENAME, FILTER_NOT_BASENAME):
-                if not self._do_basename_filtering(filter, pkg):
-                    return False
         return True
 
     def _do_installed_filtering(self,flt,pkg):
@@ -395,33 +401,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 
         return isFree == wantFree
 
-    def _do_basename_filtering(self,flt,pkg):
-        if flt == FILTER_BASENAME:
-            wantBase = True
-        else:
-            wantBase = False
-
-        isBase = self._check_basename(pkg)
-
-        return isBase == wantBase
-
-    def _check_basename(self, pkg):
-        '''
-        If a package does not have a source rpm (If that ever
-        happens), or it does have a source RPM, and the package's name
-        is the same as the source RPM's name, then we assume it is the
-        'base' package.
-        '''
-        basename = pkg.name
-
-        if pkg.sourcerpm:
-            basename = rpmUtils.miscutils.splitFilename(pkg.sourcerpm)[0]
-
-        if basename == pkg.name:
-            return True
-
-        return False
-
     def search_name(self,filters,key):
         '''
         Implement the {backend}-search-name functionality
@@ -474,6 +453,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
         self.yumbase.conf.cache = 1 # Only look in cache.
         self.status(STATUS_QUERY)
+        package_list = [] #we can't do emitting as found if we are post-processing
 
         try:
             pkgGroupDict = self._buildGroupDict()
@@ -491,7 +471,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                             group = groupMap[cg]           # use the pk group name, instead of yum 'category/group'
                     if group == key:
                         if self._do_extra_filtering(pkg, fltlist):
-                            self._show_package(pkg, INFO_INSTALLED)
+                            package_list.append((pkg,INFO_INSTALLED))
                     installed_nevra.append(self._get_nevra(pkg))
 
             if not FILTER_INSTALLED in fltlist:
@@ -506,7 +486,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                                 group = groupMap[cg]
                         if group == key:
                             if self._do_extra_filtering(pkg, fltlist):
-                                self._show_package(pkg, INFO_AVAILABLE)
+                                package_list.append((pkg,INFO_AVAILABLE))
 
         except yum.Errors.GroupsError,e:
             self.error(ERROR_GROUP_NOT_FOUND,e)
@@ -1113,6 +1093,42 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         else:
             return INFO_UNKNOWN
 
+    def _basename_filter(self, package_list):
+        '''
+        Filter the list so that the number of packages are reduced.
+        This is done by only displaying gtk2 rather than gtk2-devel, gtk2-debuginfo, etc.
+        This imlementation is done by comparing the SRPM name, and if not falling back
+        to the first entry.
+        We have to fall back else we don't emit packages where the SRPM does not produce a
+        RPM with the same name, for instance, mono produces mono-core, mono-data and mono-winforms.
+        @package_list: a (pkg,status) list of packages
+        A new list is returned that has been filtered
+        '''
+        base_list = []
+        output_list = []
+        base_list_already_got = []
+
+        #find out the srpm name and add to a new array of compound data
+        for (pkg,status) in package_list:
+            if pkg.sourcerpm:
+                base = rpmUtils.miscutils.splitFilename(pkg.sourcerpm)[0]
+                base_list.append ((pkg,status,base,pkg.version));
+            else:
+                base_list.append ((pkg,status,'nosrpm',pkg.version));
+
+        #find all the packages that match thier basename name (done seporately so we get the "best" match)
+        for (pkg,status,base,version) in base_list:
+            if base == pkg.name and (base,version) not in base_list_already_got:
+                output_list.append((pkg,status))
+                base_list_already_got.append ((base,version))
+
+        #for all the already added output lists, remove the same basename from base_list
+        for (pkg,status,base,version) in base_list:
+            if (base,version) not in base_list_already_got:
+                output_list.append((pkg,status))
+                base_list_already_got.append ((base,version))
+        return output_list
+
     def get_updates(self, filters):
         '''
         Implement the {backend}-get-updates functionality
@@ -1124,6 +1140,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.status(STATUS_INFO)
 
         fltlist = filters.split(';')
+        package_list = []
 
         try:
             ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
@@ -1134,13 +1151,20 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     notice = md.get_notice((pkg.name, pkg.version, pkg.release))
                     if notice:
                         status = self._get_status(notice)
-                        self._show_package(pkg,status)
+                        package_list.append((pkg,status))
                     else:
-                        self._show_package(pkg,INFO_NORMAL)
+                        package_list.append((pkg,INFO_NORMAL))
         except yum.Errors.RepoError,e:
             self._refresh_yum_cache()
             self.error(ERROR_NO_CACHE,"Package cache was invalid and has been rebuilt.")
-                
+
+        # basename filter if specified
+        if FILTER_BASENAME in fltlist:
+            for (pkg,status) in self._basename_filter(package_list):
+                self._show_package(pkg,status)
+        else:
+            for (pkg,status) in package_list:
+                self._show_package(pkg,status)
 
     def repo_enable(self, repoid, enable):
         '''
commit bc604b535bd5e2c53c39034a4e8c00a9a70b2182
Author: Till Maas <opensource at till.name>
Date:   Tue Apr 15 15:32:42 2008 +0100

    remove unneeded sourcing from the pm-utils script

diff --git a/data/95packagekit b/data/95packagekit
index 0c8cb0d..f6e72c3 100755
--- a/data/95packagekit
+++ b/data/95packagekit
@@ -7,8 +7,6 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-. /usr/lib/pm-utils/functions
-
 case "$1" in
 	thaw|resume)
 		# get PackageKit to invalidate its caches and get new updates
commit 236ff664b2c73c273b2aac1e4c657710e67da281
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Apr 14 23:10:32 2008 +0100

    Disable ptrace() and core dumping for applications which use libpackagekit so that local trojans cannot silently abuse privileges

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index d99abf8..a1cc7e6 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -33,6 +33,7 @@
 
 #include <string.h>
 #include <sys/types.h>
+#include <sys/prctl.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
@@ -3641,6 +3642,20 @@ pk_client_new (void)
 	return PK_CLIENT (client);
 }
 
+/**
+ * init:
+ *
+ * Library constructor: Disable ptrace() and core dumping for applications
+ * which use this library, so that local trojans cannot silently abuse PackageKit
+ * privileges.
+ */
+__attribute__ ((constructor))
+void init()
+{
+	/* this is a bandaid */
+	prctl (PR_SET_DUMPABLE, 0);
+}
+
 /***************************************************************************
  ***                          MAKE CHECK TESTS                           ***
  ***************************************************************************/
commit efc8862990d768f81ef879d091dd42e022fff11a
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Apr 14 20:54:21 2008 +0100

    don't allow org.freedesktop.packagekit.install-signature to be retained

diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in
index 1a7908d..da10422 100644
--- a/policy/org.freedesktop.packagekit.policy.in
+++ b/policy/org.freedesktop.packagekit.policy.in
@@ -31,7 +31,7 @@
     <vendor_url>http://www.packagekit.org/pk-reference.html#api-install-file</vendor_url>
     <defaults>
       <allow_inactive>no</allow_inactive>
-      <allow_active>auth_admin_keep_always</allow_active>
+      <allow_active>auth_admin</allow_active>
     </defaults>
   </action>
 
commit 2cbcf8b3e5e3a939baa01cca00c698bf32520739
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Apr 14 12:18:17 2008 +0100

    95packagekit should be executable when installed. fixes rh#442286

diff --git a/data/Makefile.am b/data/Makefile.am
index 65a0200..dcd9c18 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -81,6 +81,9 @@ EXTRA_DIST =						\
 clean-local:
 	rm -f *~
 
+install-data-hook:
+	chmod a+x $(DESTDIR)$(libdir)/pm-utils/sleep.d/95packagekit;
+
 DISTCLEANFILES =					\
 	org.freedesktop.PackageKit.service		\
 	org.freedesktop.PackageKitTestBackend.service	\
commit ac17834cbb9a1739630659feacc212298b534682
Author: Jens Granseuer <jensgr at gmx.net>
Date:   Mon Apr 14 01:31:31 2008 +0100

    fix compiling PackageKit with GCC2

diff --git a/libpackagekit/pk-debug.h b/libpackagekit/pk-debug.h
index 733dbb9..9344a9c 100644
--- a/libpackagekit/pk-debug.h
+++ b/libpackagekit/pk-debug.h
@@ -54,9 +54,9 @@ G_BEGIN_DECLS
 #define pk_warning(...) pk_warning_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 #define pk_error(...) pk_error_real (__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
 #else
-#define pk_debug
-#define pk_warning
-#define pk_error
+#define pk_debug(...)
+#define pk_warning(...)
+#define pk_error(...)
 #endif
 
 void		pk_debug_init			(gboolean	 debug);
commit 037b960b0be8189faa28e7d16eeed14c962fbecd
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Apr 13 14:31:06 2008 +0100

    don't error out with 'Package is not installed' when geting requires of a not-installed package. Fixes rh#442221

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 95b5f1a..b1666dd 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -684,10 +684,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                     for txmbr in self.yumbase.tsInfo:
                         if txmbr.po.name != pkg.name:
                             self._show_package(txmbr.po,INFO_INSTALLED)
-        else:
-            self.error(ERROR_PACKAGE_NOT_INSTALLED,"Package is not installed")
-                        
-                                
 
     def _is_inst(self,pkg):
         return self.yumbase.rpmdb.installed(po=pkg)


More information about the PackageKit-commit mailing list