Blob Blame History Raw
commit 5820dcdc3e6f9bf16e2c42d2bf37d4cbd16064dc
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
Date:   Thu Jul 21 20:38:28 2016 +0200

    Fix count of applicable security updates. BZ 1347813

diff --git a/yum/updateinfo.py b/yum/updateinfo.py
index 7abe332..5dcd7df 100644
--- a/yum/updateinfo.py
+++ b/yum/updateinfo.py
@@ -445,7 +445,6 @@ def exclude_updates(base, filters=None):
     pkgs = base.pkgSack.returnPackages()
     name2tup = _get_name2oldpkgtup(base)
     
-    cnt = 0
     pkgs_to_del = []
     for pkg in pkgs:
         name = pkg.name
@@ -453,11 +452,13 @@ def exclude_updates(base, filters=None):
             not _ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)):
             pkgs_to_del.append(pkg.name)
             continue
-        cnt += 1
     if pkgs_to_del:
         for p in base.doPackageLists(pkgnarrow='available', patterns=pkgs_to_del, showdups=True).available:
             ysp_del_pkg(p)
 
+    cnt = len(base.doPackageLists(pkgnarrow='updates').updates) + \
+          len(base.doPackageLists(pkgnarrow='obsoletes').obsoletes)
+
     _ysp_chk_used_map(used_map, lambda x: base.verbose_logger.warn("%s", x))
 
     if cnt: