[yum-git] yumcommands.py

James Antill james at linux.duke.edu
Fri Mar 28 21:27:18 UTC 2008


 yumcommands.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d9f975ea8d7243b5e2c2cb79a0e019f915ce1c5b
Author: James Antill <james at and.org>
Date:   Fri Mar 28 17:27:14 2008 -0400

    Sort "list obsoletes" results, because non-sorted results make me cry

diff --git a/yumcommands.py b/yumcommands.py
index d964231..e260526 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -25,6 +25,7 @@ from yum import logginglevels
 import yum.Errors
 from yum.i18n import _
 
+import operator
 
 def checkRootUID(base):
     """
@@ -219,7 +220,9 @@ class InfoCommand(YumCommand):
             # if we've looked up obsolete lists and it's a list request
                 rop = [0, '']
                 print _('Obsoleting Packages')
-                for obtup in ypl.obsoletesTuples:
+                # The tuple is (newPkg, oldPkg) ... so sort by new
+                for obtup in sorted(ypl.obsoletesTuples,
+                                    key=operator.itemgetter(0)):
                     base.updatesObsoletesList(obtup, 'obsoletes')
             else:
                 rop = base.listPkgs(ypl.obsoletes, _('Obsoleting Packages'), basecmd)



More information about the Yum-cvs-commits mailing list