[yum-git] Branch 'yum-3_2_X' - 2 commits - output.py yumcommands.py yum/__init__.py

James Antill james at linux.duke.edu
Sun Aug 24 23:18:50 UTC 2008


 output.py       |    6 +++++-
 yum/__init__.py |    1 +
 yumcommands.py  |    8 +++++---
 3 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit caedc3c589b556e314b49bc604d38ba1635c8656
Author: James Antill <james at and.org>
Date:   Sun Aug 24 19:16:48 2008 -0400

    Make list extras a lot faster, ~5x speedup here

diff --git a/yum/__init__.py b/yum/__init__.py
index 62b85a3..e0b2572 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1455,6 +1455,7 @@ class YumBase(depsolve.Depsolve):
             # anything installed but not in a repo is an extra
             avail = self.pkgSack.simplePkgList(patterns=patterns,
                                                ignore_case=ic)
+            avail = set(avail)
             for po in self.rpmdb.returnPackages(patterns=patterns,
                                                 ignore_case=ic):
                 if po.pkgtup not in avail:
commit 4838e70d52c03eb71a5173d677ddf231cfe8d8d7
Author: James Antill <james at and.org>
Date:   Sun Aug 24 17:44:01 2008 -0400

    Fix listPkgs() so we don't highlight with old packages using showduplicates

diff --git a/output.py b/output.py
index 609150c..cdfc46d 100644
--- a/output.py
+++ b/output.py
@@ -384,7 +384,11 @@ class YumOutput:
                 thingslisted = 1
                 print '%s' % description
                 for pkg in sorted(lst):
-                    highlight = (pkg.name, pkg.arch) in highlight_na
+                    key = (pkg.name, pkg.arch)
+                    highlight = False
+                    if key in highlight_na and pkg.verLT(highlight_na[key]):
+                        highlight = True
+
                     if outputType == 'list':
                         self.simpleList(pkg, ui_overflow=True,
                                         highlight=highlight)
diff --git a/yumcommands.py b/yumcommands.py
index f705e24..ba88e61 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -212,10 +212,12 @@ class InfoCommand(YumCommand):
         except yum.Errors.YumBaseError, e:
             return 1, [str(e)]
         else:
+            update_pkgs = {}
             if ypl.installed:
-                update_pkgs = set([(po.name, po.arch) for po in ypl.available])
-            else:
-                update_pkgs = set()
+                for pkg in ypl.available:
+                    key = (pkg.name, pkg.arch)
+                    if key not in update_pkgs or pkg.verGT(update_pkgs[key]):
+                        update_pkgs[key] = pkg
             rip = base.listPkgs(ypl.installed, _('Installed Packages'), basecmd,
                                 highlight_na=update_pkgs)
             rap = base.listPkgs(ypl.available, _('Available Packages'), basecmd)



More information about the Yum-cvs-commits mailing list