Blame SOURCES/BZ-1193871-updateinfo-notice-when-arch-changed.patch

bb45c0
diff --git a/yum/update_md.py b/yum/update_md.py
bb45c0
--- a/yum/update_md.py	2015-01-19 07:44:35.567107008 -0500
bb45c0
+++ b/yum/update_md.py	2015-01-19 08:57:31.576489424 -0500
bb45c0
@@ -398,6 +399,9 @@ class UpdateMetadata(object):
bb45c0
             except Errors.RepoMDError:
bb45c0
                 continue # No metadata found for this repo
bb45c0
 
bb45c0
+        self.arch_storage = ArchStorage()
bb45c0
+        self.archlist = self.arch_storage.archlist
bb45c0
+
bb45c0
     def get_notices(self, name=None):
bb45c0
         """ Return all notices. """
bb45c0
         if name is None:
bb45c0
@@ -434,16 +438,29 @@ class UpdateMetadata(object):
bb45c0
         name = oldpkgtup[0]
bb45c0
         arch = oldpkgtup[1]
bb45c0
         ret = []
bb45c0
+        other_arch_list = []
bb45c0
+        notices = set()
bb45c0
         for notice in self.get_notices(name):
bb45c0
             for upkg in notice['pkglist']:
bb45c0
                 for pkg in upkg['packages']:
bb45c0
+                    other_arch = False
bb45c0
                     if pkg['name'] != name or pkg['arch'] != arch:
bb45c0
-                        continue
bb45c0
+                        if (notice not in notices and pkg['name'] == name and pkg['arch'] in self.archlist):
bb45c0
+                            other_arch = True
bb45c0
+                        else:
bb45c0
+                            continue
bb45c0
                     pkgtup = (pkg['name'], pkg['arch'], pkg['epoch'] or '0',
bb45c0
                               pkg['version'], pkg['release'])
bb45c0
                     if _rpm_tup_vercmp(pkgtup, oldpkgtup) <= 0:
bb45c0
                         continue
bb45c0
-                    ret.append((pkgtup, notice))
bb45c0
+                    if other_arch:
bb45c0
+                        other_arch_list.append((pkgtup, notice))
bb45c0
+                    else:
bb45c0
+                        ret.append((pkgtup, notice))
bb45c0
+                        notices.add(notice)
bb45c0
+        for pkgtup, notice in other_arch_list:
bb45c0
+            if notice not in notices:
bb45c0
+                ret.append((pkgtup, notice))
bb45c0
         ret.sort(cmp=_rpm_tup_vercmp, key=lambda x: x[0], reverse=True)
bb45c0
         return ret
bb45c0
 
bb45c0
diff -up yum-3.4.3/yum/update_md.py.old yum-3.4.3/yum/update_md.py
bb45c0
--- yum-3.4.3/yum/update_md.py.old	2015-05-28 19:23:35.589691937 +0200
bb45c0
+++ yum-3.4.3/yum/update_md.py	2015-05-28 19:24:05.971806965 +0200
bb45c0
@@ -33,6 +33,7 @@ import Errors
bb45c0
 import logginglevels
bb45c0
 
bb45c0
 import rpmUtils.miscutils
bb45c0
+from rpmUtils.arch import ArchStorage
bb45c0
 
bb45c0
 
bb45c0
 def safe_iterparse(filename, logger=None):