[yum-commits] 2 commits - yum/update_md.py

James Antill james at osuosl.org
Wed May 8 18:21:00 UTC 2013


 yum/update_md.py |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit caf85d43be5fd07f63baed2206cc9f85a0eab862
Author: James Antill <james at and.org>
Date:   Wed May 8 14:20:05 2013 -0400

    Massive hack for Fedora/updateinfo stable vs. testing statuses. BZ 960642.

diff --git a/yum/update_md.py b/yum/update_md.py
index d04fe74..714de89 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -104,8 +104,23 @@ class UpdateNotice(object):
                      'severity', 'release',
                      'issued', 'updated', 'version', 'pushcount',
                      'from', 'title', 'summary', 'description', 'solution'):
+            if data == 'status': # FIXME: See below...
+                continue
             if self._md[data] != other._md[data]:
                 return False
+        # FIXME: Massive hack, Fedora is really broken and gives status=stable
+        # and status=testing for updateinfo notices, just depending on which
+        # repo. they come from.
+        data = 'status'
+        if self._md[data] != other._md[data]:
+            if self._md[data]  not in ('stable', 'testing'):
+                return False
+            if other._md[data] not in ('stable', 'testing'):
+                return False
+            # They are both really "stable" ...
+            self._md[data]  = 'stable'
+            other._md[data] = 'stable'
+
         return True
 
     def __ne__(self, other):
commit cfb03b4bcc3e20f089cbf7c8e4b98d2295174b8f
Author: James Antill <james at and.org>
Date:   Wed May 8 14:18:38 2013 -0400

    Tell which repo. we are skipping the updateinfo notice from.

diff --git a/yum/update_md.py b/yum/update_md.py
index 3ac0010..d04fe74 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -503,12 +503,14 @@ class UpdateMetadata(object):
         """ Parse a metadata from a given YumRepository, file, or filename. """
         if not obj:
             raise UpdateNoticeException
+        repoid = None
         if type(obj) in (type(''), type(u'')):
             unfile = decompress(obj)
             infile = open(unfile, 'rt')
 
         elif isinstance(obj, YumRepository):
             if obj.id not in self._repos:
+                repoid = obj.id
                 self._repos.append(obj.id)
                 md = obj.retrieveMD(mdtype)
                 if not md:
@@ -529,7 +531,11 @@ class UpdateMetadata(object):
                     # what else should we do?
                     continue
                 if not self.add_notice(un):
-                    print >> sys.stderr, "An update notice is broken, or duplicate, skipping:", un['update_id']
+                    if repoid is None:
+                        upid = un['update_id']
+                    else:
+                        upid = "%s/%s" % (repoid, un['update_id'])
+                    print >> sys.stderr, "An update notice is broken, or duplicate, skipping:", upid
 
     def __unicode__(self):
         ret = u''


More information about the Yum-commits mailing list