[yum-git] Branch 'yum-3_2_X' - 2 commits - cli.py output.py

James Antill james at linux.duke.edu
Mon Jun 30 22:48:20 UTC 2008


 cli.py    |   15 ++++++++++++++-
 output.py |    3 +--
 2 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 62ea2739285ab14df7ce813f0f3c7bb75de24be0
Author: James Antill <james at and.org>
Date:   Mon Jun 30 18:43:59 2008 -0400

    Add installed yum info. to --version

diff --git a/cli.py b/cli.py
index 1672123..34c2513 100644
--- a/cli.py
+++ b/cli.py
@@ -161,7 +161,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         # Just print out the version if that's what the user wanted
         if opts.version:
             print yum.__version__
-            sys.exit(0)
+            opts.quiet = True
+            opts.verbose = False
 
         # get the install root to use
         root = self.optparser.getRoot(opts)
@@ -195,6 +196,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         # apply some of the options to self.conf
         (opts, self.cmds) = self.optparser.setupYumConfig()
 
+        if opts.version:
+            self.conf.cache = 1
+            for pkg in self.rpmdb.returnPackages(patterns=['yum']):
+                # We should only have 1 return...
+                print _("  Installed version: %s") % pkg
+                print _("  Committer        : %s") % pkg.committer
+                print _("  Committime       : %s") % time.ctime(pkg.committime)
+                print _("  Buildtime        : %s") % time.ctime(pkg.buildtime)
+                if hasattr(pkg, 'installtime'):
+                    print _("  Installtime      : %s") % time.ctime(pkg.installtime)
+            sys.exit(0)
+
         if opts.sleeptime is not None:
             sleeptime = random.randrange(opts.sleeptime*60)
         else:
commit 5e4d89125274b226d54f21aad25fc4ca583624f4
Author: James Antill <james at and.org>
Date:   Mon Jun 30 18:41:01 2008 -0400

     Use normal packaging sorting in simpleList()

diff --git a/output.py b/output.py
index 44600ce..6d9006d 100644
--- a/output.py
+++ b/output.py
@@ -334,8 +334,7 @@ class YumOutput:
             if len(lst) > 0:
                 thingslisted = 1
                 print '%s' % description
-                lst.sort(sortPkgObj)
-                for pkg in lst:
+                for pkg in sorted(lst):
                     if outputType == 'list':
                         self.simpleList(pkg, ui_overflow=True)
                     elif outputType == 'info':



More information about the Yum-cvs-commits mailing list