[Yum-devel] [PATCH] yum changelog: implicit since=all. BZ 961782

Zdenek Pavlas zpavlas at redhat.com
Thu Jul 25 08:37:47 UTC 2013


dateutil.parser.parse("junk", fuzzy=True) happily returns
the current date, so when users omit the "since" argument
we don't complain.  Insert an implicit "all" arg instead.
---
 plugins/changelog/changelog.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/plugins/changelog/changelog.py b/plugins/changelog/changelog.py
index 16144c6..d09281a 100644
--- a/plugins/changelog/changelog.py
+++ b/plugins/changelog/changelog.py
@@ -102,7 +102,7 @@ class ChangeLogCommand:
         return ['changelog', 'ChangeLog']
 
     def getUsage(self):
-        return "<date>|<number>|all [PACKAGE|all|installed|updates|extras|obsoletes|recent]"
+        return "[<date>|<number>|all] [PACKAGE|all|installed|updates|extras|obsoletes|recent]"
 
     def getSummary(self):
         return """\
@@ -212,6 +212,15 @@ Display changelog data, since a specified time, on a group of packages"""
                     msg = "Argument -- %s -- is not valid: %s" % (since, to_str(e))
                     raise PluginYumExit(msg)
 
+                if self._since_dto == dateutil_parser.parse('garbage', fuzzy=True):
+                    # 'since' was a package name, not a date
+                    extcmds.insert(0, since)
+
+                    # assume since="all"
+                    self._since_all = True
+                    self._since_dto = None
+                    self._since_tt  = None
+
         ypl = base.returnPkgLists(extcmds)
         self.show_data(msg, ypl.installed, 'Installed Packages')
         self.show_data(msg, ypl.available, 'Available Packages')
-- 
1.7.11.7



More information about the Yum-devel mailing list