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

Richard Hughes hughsient at kemper.freedesktop.org
Sun Jan 6 06:09:50 PST 2008


 backends/yum/helpers/yumBackend.py |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 5ec751548f35a7866f02c07a8232ec2791d564a5
Author: Tim Lauridsen <tim at naboo.local>
Date:   Sun Jan 6 07:53:34 2008 +0100

    yum: implemented vendor_url for urls != bugzilla,cve

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c2a2ff3..f4dc448 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1103,11 +1103,11 @@ 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': []}
         if notice:
             # Update Description
             desc = notice['description']
             # Update References (Bugzilla,CVE ...)
-            urls = {'bugzilla':[], 'cve' : []}
             refs = notice['references']
             if refs:
                 for ref in refs:
@@ -1119,8 +1119,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 			    title = ""
                         urls[typ].append("%s;%s" % (href,title))
                     else:
-                        print " unknown url type : %s " % typ
-                        print ref
+                        urls['vendor'].append("%s;%s" % (ref['href'],ref['title']))
                         
             # Reboot flag
             if notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']:
@@ -1129,7 +1128,6 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 reboot = 'none'
             return self._format_str(desc),urls,reboot
         else:
-            urls = {'bugzilla':[], 'cve' : []}
             return "",urls,"none"
 
     def get_update_detail(self,package):
@@ -1145,7 +1143,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         desc,urls,reboot = self._get_update_extras(pkg)
         cve_url = self._format_list(urls['cve'])
         bz_url = self._format_list(urls['bugzilla'])
-        self.update_detail(package,update,obsolete,"",bz_url,cve_url,reboot,desc)
+        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):
         '''
commit 9c4128c7087789643d9a0602432237b1b5d62e1f
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Sat Jan 5 12:30:36 2008 -0500

    Use "" instead of "none" for missing urls or url parts.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 71ff5b3..c2a2ff3 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1112,8 +1112,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             if refs:
                 for ref in refs:
                     typ = ref['type']
-                    if typ in ('bugzilla','cve'):
-                        urls[typ].append("%s;%s" % (ref['href'],ref['title']))
+		    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:
                         print " unknown url type : %s " % typ
                         print ref
@@ -1141,7 +1145,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         desc,urls,reboot = self._get_update_extras(pkg)
         cve_url = self._format_list(urls['cve'])
         bz_url = self._format_list(urls['bugzilla'])
-        self.update_detail(package,update,obsolete,"none",bz_url,cve_url,reboot,desc)
+        self.update_detail(package,update,obsolete,"",bz_url,cve_url,reboot,desc)
 
     def repo_set_data(self, repoid, parameter, value):
         '''



More information about the PackageKit mailing list