Fix performance issue introduced by e78ed1ccddf619e25aea74bdedcbe42cd9732f85 master
authorValentina Mukhamedzhanova <vmukhame@redhat.com>
Mon, 25 Jan 2016 11:43:27 +0000 (12:43 +0100)
committerValentina Mukhamedzhanova <vmukhame@redhat.com>
Mon, 25 Jan 2016 11:43:27 +0000 (12:43 +0100)
yum/updateinfo.py

index 3e6395e..87ec962 100644 (file)
@@ -411,14 +411,16 @@ def exclude_updates(base, filters=None):
     name2tup = _get_name2oldpkgtup(base)
     
     cnt = 0
+    pkgs_to_del = []
     for pkg in pkgs:
         name = pkg.name
         if (name not in name2tup or
             not _ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)):
-            for p in base.doPackageLists(pkgnarrow='available', patterns=[pkg.name], showdups=True).available:
-                ysp_del_pkg(p)
+                pkgs_to_del.append(pkg.name)
             continue
         cnt += 1
+    for p in base.doPackageLists(pkgnarrow='available', patterns=pkgs_to_del, showdups=True).available:
+        ysp_del_pkg(p)
 
     _ysp_chk_used_map(used_map, lambda x: base.verbose_logger.warn("%s", x))