[yum-commits] 2 commits - plugins/changelog yum-utils.spec

James Antill james at osuosl.org
Thu Feb 26 20:14:37 UTC 2009


 plugins/changelog/changelog.py |   21 ++++++++++++++-------
 yum-utils.spec                 |    2 +-
 2 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 8e0bcd3eec3060be6a48b20d734f31ad7236cca2
Author: James Antill <james at and.org>
Date:   Thu Feb 26 15:14:08 2009 -0500

    Cleanup the ChangeLog output, also fix unicode issue (bad/no utf8 *sigh*)

diff --git a/plugins/changelog/changelog.py b/plugins/changelog/changelog.py
index dba195a..c2018ee 100644
--- a/plugins/changelog/changelog.py
+++ b/plugins/changelog/changelog.py
@@ -27,6 +27,8 @@ from yum.plugins import PluginYumExit
 from yum import logginglevels
 import logging
 
+from yum.i18n import to_unicode
+
 try:
     import dateutil.parser as dateutil_parser
 except ImportError:
@@ -68,9 +70,16 @@ def show_changes(conduit, msg):
         if origpkgs.has_key(name):
             for rpm in srpms[name]:
                 rpms.append("%s" % rpm)
-            conduit.info(2, ", ".join(sorted(rpms)))
+            done = False
+            kvf = conduit._base.fmtKeyValFill
+            rpm_names = ", ".join(sorted(rpms))
             for line in changelog_delta(srpms[name][0], origpkgs[name]):
-                conduit.info(2, "%s\n" % line)
+                if not done:
+                    conduit.info(2,kvf("ChangeLog for: ", rpm_names))
+                done = True
+                conduit.info(2, "%s\n" % to_unicode(line))
+            if not done:
+                conduit.info(2, "%s\n" % kvf("** No ChangeLog for: ",rpm_names))
 
 class ChangeLogCommand:
 
diff --git a/yum-utils.spec b/yum-utils.spec
index 6416909..210c316 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -39,7 +39,7 @@ Group: System Environment/Base
 Provides: yum-changelog
 Obsoletes: yum-changelog < 1.1.20-0
 Conflicts: yum-changelog < 1.1.20-0
-Requires: yum >= 3.0
+Requires: yum >= 3.2.19
 Requires: python-dateutil
 
 %description -n yum-plugin-changelog
commit 4697fb6f7e8677d0c6392a0b8918415b9b14acfe
Author: James Antill <james at and.org>
Date:   Thu Feb 26 14:53:58 2009 -0500

    Only download changelog data for repos. we need it from

diff --git a/plugins/changelog/changelog.py b/plugins/changelog/changelog.py
index fc32270..dba195a 100644
--- a/plugins/changelog/changelog.py
+++ b/plugins/changelog/changelog.py
@@ -217,17 +217,15 @@ def config_hook(conduit):
         parser.add_option('--changelog', action='store_true', 
                       help='Show changelog delta of updated packages')
 
-def postreposetup_hook(conduit):
+def _setup_changelog_from_cmdline(conduit):
     global changelog
     opts, args = conduit.getCmdLine()
     if not changelog and opts:
         changelog = opts.changelog
 
-    if changelog:
-        repos = conduit.getRepos()
-        repos.populateSack(mdtype='otherdata')
-
 def postresolve_hook(conduit):
+    _setup_changelog_from_cmdline(conduit)
+
     if not changelog: 
         return
 


More information about the Yum-commits mailing list