[yum-git] 4 commits - cli.py yum/__init__.py yum/misc.py yum/rpmsack.py

James Antill james at linux.duke.edu
Thu Apr 10 18:02:43 UTC 2008


 cli.py          |    2 +-
 yum/__init__.py |   10 +++++++++-
 yum/misc.py     |    2 ++
 yum/rpmsack.py  |    4 +++-
 4 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit c0f025a79e108aa7c4752f4222a05b6dbf275a0a
Author: James Antill <james at and.org>
Date:   Thu Apr 10 13:39:16 2008 -0400

    Work around weird version type ... problem was fixed by touch *.py

diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index dc4057c..8f47bab 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -514,7 +514,9 @@ class RPMDBPackageSack(PackageSackBase):
         # would this ever be a ListType?
         elif type(version) in (types.TupleType, types.ListType):
             (r_e, r_v, r_r) = version
-        elif type(version) is types.NoneType:
+        else:
+            # FIXME: This isn't always  type(version) is types.NoneType:
+            # ...not sure what it is though, come back to this
             r_e = r_v = r_r = None
 
         deptup = (name, misc.share_data(flags),
commit b8667f1e06d7c2fb6a03dfd7c08bdf687a712b1d
Author: James Antill <james at and.org>
Date:   Thu Apr 10 12:53:07 2008 -0400

    Magic rpm errors, bug#441860

diff --git a/yum/__init__.py b/yum/__init__.py
index 270f79f..efd5a40 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -759,11 +759,19 @@ class YumBase(depsolve.Depsolve):
     def runTransaction(self, cb):
         """takes an rpm callback object, performs the transaction"""
 
+        def _tup2str(x):
+            # Convert stuff like:
+            # ('installing package FOO needs XMB on the Y filesystem',
+            #  (9, '/', 131633152L))
+            if type(x) == type(tuple):
+                return x[0]
+            return x
+
         self.plugins.run('pretrans')
 
         errors = self.ts.run(cb.callback, '')
         if errors:
-            errstring = '\n'.join(errors)
+            errstring = '\n'.join(map(_tup2str, errors))
             raise Errors.YumBaseError, errstring
 
         if not self.conf.keepcache:
commit b5e5671ffcb1e942e385155fe0d144ed2fb5992b
Author: James Antill <james at and.org>
Date:   Wed Apr 9 11:49:42 2008 -0400

    Tiny pychecker fix

diff --git a/cli.py b/cli.py
index 741fcc7..125b09c 100644
--- a/cli.py
+++ b/cli.py
@@ -381,7 +381,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         tt_st = time.time()            
         self.verbose_logger.log(yum.logginglevels.INFO_2,
             _('Running Transaction Test'))
-        if self.conf.diskspacecheck == False:
+        if not self.conf.diskspacecheck:
             self.tsInfo.probFilterFlags.append(rpm.RPMPROB_FILTER_DISKSPACE)
             
         
commit 7edf04f6e4b3c5ddb88c73194231def7ead405fc
Author: James Antill <james at and.org>
Date:   Tue Apr 8 12:07:34 2008 -0400

    Add comment

diff --git a/yum/misc.py b/yum/misc.py
index e1b9d4a..c164e87 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -535,6 +535,8 @@ def to_unicode(obj, encoding='utf-8'):
 
 def to_str(obj):
     """ Convert something to a string, if it isn't one. """
+    # NOTE: unicode counts as a string just fine. We just want objects to call
+    # their __str__ methods.
     if not isinstance(obj, basestring):
         obj = str(obj)
     return obj



More information about the Yum-cvs-commits mailing list