[yum-commits] Branch 'yum-3_2_X' - 2 commits - rpmUtils/miscutils.py yum/yumRepo.py

James Antill james at osuosl.org
Mon Mar 30 00:08:54 UTC 2009


 rpmUtils/miscutils.py |    6 +++++-
 yum/yumRepo.py        |    8 +++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 5daec4bf612037cff9fbaf34669e5c76884c9183
Author: James Antill <james at and.org>
Date:   Sun Mar 29 20:04:27 2009 -0400

    Add url to mirrorlist again, make non-Fedora/metalink happy :)

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index ba052e6..7b7f9f2 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1529,7 +1529,7 @@ class YumRepository(Repository, config.RepoConf):
         self.interrupt_callback = callback
         self._callbacks_changed = True
 
-    def _readMirrorList(self, fo):
+    def _readMirrorList(self, fo, url=None):
         """ read the mirror list from the specified file object """
         returnlist = []
 
@@ -1538,7 +1538,9 @@ class YumRepository(Repository, config.RepoConf):
             try:
                 content = fo.readlines()
             except Exception, e:
-                print "Could not read mirrorlist, error was \n%s" %(e)
+                if url is None: # Shouldn't happen
+                    url = "<unknown>"
+                print "Could not read mirrorlist %s, error was \n%s" %(url, e)
                 content = []
             for line in content:
                 if re.match('^\s*\#.*', line) or re.match('^\s*$', line):
@@ -1575,7 +1577,7 @@ class YumRepository(Repository, config.RepoConf):
                 print "Could not retrieve mirrorlist %s error was\n%s" % (url, e)
                 fo = None
 
-        (returnlist, content) = self._readMirrorList(fo)
+        (returnlist, content) = self._readMirrorList(fo, url)
 
         if returnlist:
             if not self.cache and not cacheok:
commit bacabf7ad9883d191fad9c9ffdee4b7c3b2024df
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu Mar 5 23:58:41 2009 +0200

    Don't treat gpg-pubkeys imported with rpm < 4.6.0 as source packages in pkgTupleFromHeader().

diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
index ee8cd79..0e04194 100644
--- a/rpmUtils/miscutils.py
+++ b/rpmUtils/miscutils.py
@@ -111,7 +111,11 @@ def pkgTupleFromHeader(hdr):
        None epoch to 0, as well."""
    
     name = hdr['name']
-    if hdr[rpm.RPMTAG_SOURCERPM]:
+
+    # RPMTAG_SOURCEPACKAGE: RPMTAG_SOURCERPM is not necessarily there for
+    # e.g. gpg-pubkeys imported with older rpm versions
+    # http://lists.baseurl.org/pipermail/yum/2009-January/022275.html
+    if hdr[rpm.RPMTAG_SOURCERPM] or hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
         arch = hdr['arch']
     else:
         arch = 'src'


More information about the Yum-commits mailing list