Blame SOURCES/BZ-1347813-security-updates-count.patch

5e9bef
commit 5820dcdc3e6f9bf16e2c42d2bf37d4cbd16064dc
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Thu Jul 21 20:38:28 2016 +0200
5e9bef
5e9bef
    Fix count of applicable security updates. BZ 1347813
5e9bef
5e9bef
diff --git a/yum/updateinfo.py b/yum/updateinfo.py
5e9bef
index 7abe332..5dcd7df 100644
5e9bef
--- a/yum/updateinfo.py
5e9bef
+++ b/yum/updateinfo.py
5e9bef
@@ -445,7 +445,6 @@ def exclude_updates(base, filters=None):
5e9bef
     pkgs = base.pkgSack.returnPackages()
5e9bef
     name2tup = _get_name2oldpkgtup(base)
5e9bef
     
5e9bef
-    cnt = 0
5e9bef
     pkgs_to_del = []
5e9bef
     for pkg in pkgs:
5e9bef
         name = pkg.name
5e9bef
@@ -453,11 +452,13 @@ def exclude_updates(base, filters=None):
5e9bef
             not _ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)):
5e9bef
             pkgs_to_del.append(pkg.name)
5e9bef
             continue
5e9bef
-        cnt += 1
5e9bef
     if pkgs_to_del:
5e9bef
         for p in base.doPackageLists(pkgnarrow='available', patterns=pkgs_to_del, showdups=True).available:
5e9bef
             ysp_del_pkg(p)
5e9bef
 
5e9bef
+    cnt = len(base.doPackageLists(pkgnarrow='updates').updates) + \
5e9bef
+          len(base.doPackageLists(pkgnarrow='obsoletes').obsoletes)
5e9bef
+
5e9bef
     _ysp_chk_used_map(used_map, lambda x: base.verbose_logger.warn("%s", x))
5e9bef
 
5e9bef
     if cnt: