yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

Blame SOURCES/BZ-1292160-security-lists-wrong-arch-updates.patch

5e9bef
commit 6b25184fcd5634d0abcdda0ed77e75a38a0d5186
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Wed Dec 16 16:28:48 2015 +0100
5e9bef
5e9bef
    Fix updateinfo to exclude wrong arch updates
5e9bef
5e9bef
diff --git a/yum/updateinfo.py b/yum/updateinfo.py
5e9bef
index 59374af..3e6395e 100644
5e9bef
--- a/yum/updateinfo.py
5e9bef
+++ b/yum/updateinfo.py
5e9bef
@@ -401,24 +401,17 @@ def exclude_updates(base, filters=None):
5e9bef
 
5e9bef
     used_map = _ysp_gen_used_map(opts)
5e9bef
 
5e9bef
-    # In theory the official API is:
5e9bef
-    #
5e9bef
-    # pkgs = base.pkgSack.returnPackages()
5e9bef
-    #
5e9bef
-    # ...however that is _extremely_ slow, deleting all packages. So we ask
5e9bef
-    # for the list of update packages, which is all we care about.    
5e9bef
     upds = base.doPackageLists(pkgnarrow='updates')
5e9bef
-    pkgs = upds.updates
5e9bef
+    tot = len(upds.updates)
5e9bef
     # In theory we don't need to do this in some cases, but meh.
5e9bef
     upds = base.doPackageLists(pkgnarrow='obsoletes')
5e9bef
-    pkgs += upds.obsoletes
5e9bef
+    tot += len(upds.obsoletes)
5e9bef
 
5e9bef
+    pkgs = conduit.getPackages()
5e9bef
     name2tup = _get_name2oldpkgtup(base)
5e9bef
     
5e9bef
-    tot = 0
5e9bef
     cnt = 0
5e9bef
     for pkg in pkgs:
5e9bef
-        tot += 1
5e9bef
         name = pkg.name
5e9bef
         if (name not in name2tup or
5e9bef
             not _ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)):