[Yum-devel] [PATCH 2/4] Speedup distro-sync, only get the latest pkgs for those we are interested in

James Antill james at and.org
Mon Apr 19 20:00:24 UTC 2010


---
 cli.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/cli.py b/cli.py
index 1678e65..4d5b538 100644
--- a/cli.py
+++ b/cli.py
@@ -721,7 +721,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
             del ipkgs[installed[0]]
 
         apkgs = {}
-        for pkg in self.pkgSack.returnNewestByName():
+        pkgs = []
+        if ipkgs:
+            try:
+                pkgs = self.pkgSack.returnNewestByName(patterns=ipkgs.keys())
+            except Errors.PackageSackError:
+                pkgs = []
+
+        for pkg in pkgs:
             if pkg.name not in ipkgs:
                 continue
             apkgs[pkg.name] = pkg
-- 
1.6.6.1



More information about the Yum-devel mailing list