[yum-commits] Branch 'yum-3_2_X' - 2 commits - output.py yum/repos.py yumcommands.py
James Antill
james at osuosl.org
Sat Apr 4 15:39:45 UTC 2009
output.py | 11 +++++++----
yum/repos.py | 4 ++--
yumcommands.py | 5 ++++-
3 files changed, 13 insertions(+), 7 deletions(-)
New commits:
commit cb14b1fabb6e3c5c3d9869d547becb28c3fee31e
Author: James Antill <james at and.org>
Date: Sat Apr 4 11:37:08 2009 -0400
Revert part of d0ed077f779050930cdcd09b2618966482a430bb.
Fix indentation change in pylint cleanup.
diff --git a/yum/repos.py b/yum/repos.py
index 0fba1c6..1c67489 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -76,8 +76,8 @@ class RepoStorage:
repo.setup(self.ayum.conf.cache, self.ayum.mediagrabber,
gpg_import_func = self.gpg_import_func, confirm_func=self.confirm_func)
num += 1
- if self.callback and len(repos) > 0:
- self.callback.progressbar(num, len(repos), repo.id)
+ if self.callback and len(repos) > 0:
+ self.callback.progressbar(num, len(repos), repo.id)
self._setup = True
self.ayum.plugins.run('postreposetup')
commit aa3b2c58d17790307c8fefd161cfd408d3ab390d
Author: James Antill <james at and.org>
Date: Sat Apr 4 11:10:07 2009 -0400
Only do yumdb_info lookups on installed pkgs, fix the column calcs.
diff --git a/output.py b/output.py
index d902177..16da351 100755
--- a/output.py
+++ b/output.py
@@ -470,7 +470,7 @@ class YumOutput:
na = '%s%s.%s' % (indent, pkg.name, pkg.arch)
hi_cols = [highlight, 'normal', 'normal']
rid = pkg.repoid
- if 'repoid' in pkg.yumdb_info:
+ if pkg.repoid == 'installed' and 'repoid' in pkg.yumdb_info:
rid = '@' + pkg.yumdb_info.repoid
columns = zip((na, ver, rid), columns, hi_cols)
print self.fmtColumns(columns)
@@ -485,7 +485,7 @@ class YumOutput:
envra = '%s%s' % (indent, str(pkg))
hi_cols = [highlight, 'normal', 'normal']
rid = pkg.repoid
- if hasattr(pkg, 'yumdb_info') and 'repoid' in pkg.yumdb_info:
+ if pkg.repoid == 'installed' and 'repoid' in pkg.yumdb_info:
rid = '@' + pkg.yumdb_info.repoid
columns = zip((envra, rid), columns, hi_cols)
print self.fmtColumns(columns)
@@ -539,7 +539,7 @@ class YumOutput:
print _("Release : %s") % to_unicode(pkg.release)
print _("Size : %s") % self.format_number(float(pkg.size))
print _("Repo : %s") % to_unicode(pkg.repoid)
- if hasattr(pkg, 'yumdb_info') and 'repoid' in pkg.yumdb_info:
+ if pkg.repoid == 'installed' and 'repoid' in pkg.yumdb_info:
print _("From repo : %s") % to_unicode(pkg.yumdb_info.repoid)
if self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3):
print _("Committer : %s") % to_unicode(pkg.committer)
@@ -684,7 +684,10 @@ class YumOutput:
for (apkg, ipkg) in pkg_names2pkgs[item]:
pkg = ipkg or apkg
envra = utf8_width(str(pkg)) + utf8_width(indent)
- rid = len(pkg.repoid)
+ if pkg.repoid == 'installed' and 'repoid' in pkg.yumdb_info:
+ rid = len(pkg.yumdb_info.repoid) + 1
+ else:
+ rid = len(pkg.repoid)
for (d, v) in (('envra', envra), ('rid', rid)):
data[d].setdefault(v, 0)
data[d][v] += 1
diff --git a/yumcommands.py b/yumcommands.py
index aa459e6..3fe0e02 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -207,7 +207,10 @@ def _add_pkg_simple_list_lens(data, pkg, indent=''):
This "knows" about simpleList and printVer. """
na = len(pkg.name) + 1 + len(pkg.arch) + len(indent)
ver = len(pkg.version) + 1 + len(pkg.release)
- rid = len(pkg.repoid)
+ if pkg.repoid == 'installed' and 'repoid' in pkg.yumdb_info:
+ rid = len(pkg.yumdb_info.repoid) + 1
+ else:
+ rid = len(pkg.repoid)
if pkg.epoch != '0':
ver += len(pkg.epoch) + 1
for (d, v) in (('na', na), ('ver', ver), ('rid', rid)):
More information about the Yum-commits
mailing list