[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/__init__.py yum/depsolve.py yum/i18n.py
James Antill
james at osuosl.org
Thu Mar 5 05:44:43 UTC 2009
yum/__init__.py | 2 +-
yum/depsolve.py | 6 +++---
yum/i18n.py | 11 ++++++++++-
3 files changed, 14 insertions(+), 5 deletions(-)
New commits:
commit 6a9c284526c10c119636d66364181ddbbdbeb8ef
Author: James Antill <james at and.org>
Date: Thu Mar 5 00:42:32 2009 -0500
If we do resolveDeps() a second time, then if we failed make sure we do a
full check the second time through. Otherwise we'll miss conflicts
unless we get new ones.
diff --git a/yum/__init__.py b/yum/__init__.py
index 5acadca..d74d2f1 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -688,7 +688,7 @@ class YumBase(depsolve.Depsolve):
self.plugins.run('postresolve', rescode=rescode, restring=restring)
if self.tsInfo.changed:
- (rescode, restring) = self.resolveDeps()
+ (rescode, restring) = self.resolveDeps(rescode == 1)
if self.tsInfo.pkgSack is not None: # rm Transactions don't have pkgSack
self.tsInfo.pkgSack.dropCachedData()
self.rpmdb.dropCachedData()
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 97f2b3f..9024957 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -668,7 +668,7 @@ class Depsolve(object):
p.print_stats(20)
return rc
- def resolveDeps(self):
+ def resolveDeps(self, full_check=True):
if not len(self.tsInfo):
return (0, [_('Success - empty transaction')])
@@ -679,8 +679,8 @@ class Depsolve(object):
self.tsInfo.resetResolved(hard=False)
CheckDeps = True
- CheckRemoves = False
- CheckInstalls = False
+ CheckRemoves = full_check
+ CheckInstalls = full_check
missingdep = 0
errors = []
commit b3b33e6cbab47ef9ea7416ce0eb8211ffd7a43be
Author: James Antill <james at and.org>
Date: Tue Mar 3 01:00:47 2009 -0500
Fix highlighting on len(msg) == width lines
diff --git a/yum/i18n.py b/yum/i18n.py
index af70881..50d0bd3 100755
--- a/yum/i18n.py
+++ b/yum/i18n.py
@@ -244,6 +244,8 @@ def utf8_width_fill(msg, fill, chop=None, left=True, prefix='', suffix=''):
""" Expand a utf8 msg to a specified "width" or chop to same.
Expansion can be left or right. This is what you want to use instead of
%*.*s, as it does the "right" thing with regard to utf-8 sequences.
+ prefix and suffix should be used for "invisible" bytes, like
+ highlighting.
Eg.
"%-*.*s" % (10, 20, msg)
<= becomes =>
@@ -252,11 +254,18 @@ def utf8_width_fill(msg, fill, chop=None, left=True, prefix='', suffix=''):
"%20.10s" % (msg)
<= becomes =>
"%s" % (utf8_width_fill(msg, 20, 10, left=False)).
+
+ "%s%.10s%s" % (prefix, msg, suffix)
+ <= becomes =>
+ "%s" % (utf8_width_fill(msg, 0, 10, prefix=prefix, suffix=suffix)).
"""
passed_msg = msg
width, msg = utf8_width_chop(msg, chop)
- if width < fill:
+ if width >= fill:
+ if prefix or suffix:
+ msg = ''.join([prefix, msg, suffix])
+ else:
extra = " " * (fill - width)
if left:
msg = ''.join([prefix, msg, suffix, extra])
More information about the Yum-commits
mailing list