[yum-commits] Branch 'yum-3_2_X' - 2 commits - cli.py output.py
James Antill
james at osuosl.org
Tue Mar 15 15:56:01 UTC 2011
cli.py | 13 ++++++++-----
output.py | 8 +++++++-
2 files changed, 15 insertions(+), 6 deletions(-)
New commits:
commit 61cb3688aeb94d670b92a2d145c0b3b6ade5373b
Author: James Antill <james at and.org>
Date: Tue Mar 15 10:48:18 2011 -0400
Sort the pkgs. in depListOutput, also only print the latest unless -v.
diff --git a/output.py b/output.py
index 1613c29..e61cca9 100755
--- a/output.py
+++ b/output.py
@@ -809,6 +809,7 @@ class YumOutput:
def depListOutput(self, results):
"""take a list of findDeps results and 'pretty print' the output"""
+ verb = self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
for pkg in results:
print _("package: %s") % pkg.compactPrint()
if len(results[pkg]) == 0:
@@ -822,7 +823,12 @@ class YumOutput:
print _(" Unsatisfied dependency")
continue
- for po in reqlist:
+ seen = {}
+ for po in reversed(sorted(reqlist)):
+ key = (po.name, po.arch)
+ if not verb and key in seen:
+ continue
+ seen[key] = po
print " provider: %s" % po.compactPrint()
def format_number(self, number, SI=0, space=' '):
commit b072ad548318c3f93a874b6ab11d5e2be61c884c
Author: James Antill <james at and.org>
Date: Tue Mar 15 10:25:49 2011 -0400
Use --showduplicates in deplist, don't reoutput pkgs. each time around loop.
diff --git a/cli.py b/cli.py
index 576126d..2267b86 100644
--- a/cli.py
+++ b/cli.py
@@ -1070,13 +1070,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
os.path.exists(arg))):
thispkg = yum.packages.YumUrlPackage(self, self.ts, arg)
pkgs.append(thispkg)
+ elif self.conf.showdupesfromrepos:
+ pkgs.extend(self.pkgSack.returnPackages(patterns=[arg]))
else:
- ematch, match, unmatch = self.pkgSack.matchPackageNames([arg])
- for po in ematch + match:
- pkgs.append(po)
+ try:
+ pkgs.extend(self.pkgSack.returnNewestByName(patterns=[arg]))
+ except yum.Errors.PackageSackError:
+ pass
- results = self.findDeps(pkgs)
- self.depListOutput(results)
+ results = self.findDeps(pkgs)
+ self.depListOutput(results)
return 0, []
More information about the Yum-commits
mailing list