[yum-commits] Branch 'yum-3_2_X' - 4 commits - yumcommands.py yum/__init__.py yum/misc.py

James Antill james at osuosl.org
Fri Feb 18 20:23:47 UTC 2011


 yum/__init__.py |    6 +++++-
 yum/misc.py     |    7 +++++--
 yumcommands.py  |    3 ++-
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 6f843ab560a3965cd66c7404776d1b908181d2b1
Author: James Antill <james at and.org>
Date:   Fri Feb 18 14:18:49 2011 -0500

    Pass any check-update arguments to "list obsoletes".

diff --git a/yumcommands.py b/yumcommands.py
index f196477..62b8746 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -626,13 +626,14 @@ class CheckUpdateCommand(YumCommand):
         checkEnabledRepo(base)
 
     def doCommand(self, base, basecmd, extcmds):
+        obscmds = ['obsoletes'] + extcmds
         base.extcmds.insert(0, 'updates')
         result = 0
         try:
             ypl = base.returnPkgLists(extcmds)
             if (base.conf.obsoletes or
                 base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)):
-                typl = base.returnPkgLists(['obsoletes'])
+                typl = base.returnPkgLists(obscmds)
                 ypl.obsoletes = typl.obsoletes
                 ypl.obsoletesTuples = typl.obsoletesTuples
 
commit aa94b544dfe5a9926ff980ccc5f972abc59e0970
Author: James Antill <james at and.org>
Date:   Fri Feb 18 12:56:13 2011 -0500

    Workaround stupid len() assert in 32bit python.

diff --git a/yum/misc.py b/yum/misc.py
index 15e571f..8e81c34 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -252,6 +252,9 @@ class Checksums:
     def __len__(self):
         return self._len
 
+    # Note that len(x) is assert limited to INT_MAX, which is 2GB on i686.
+    length = property(fget=lambda self: self._len)
+
     def update(self, data):
         self._len += len(data)
         for sumalgo in self._sumalgos:
@@ -323,7 +326,7 @@ def checksum(sumtype, file, CHUNK=2**16, datasize=None):
 
         data = Checksums([sumtype])
         while data.read(fo, CHUNK):
-            if datasize is not None and len(data) > datasize:
+            if datasize is not None and data.length > datasize:
                 break
 
         if type(file) is types.StringType:
@@ -332,7 +335,7 @@ def checksum(sumtype, file, CHUNK=2**16, datasize=None):
             
         # This screws up the length, but that shouldn't matter. We only care
         # if this checksum == what we expect.
-        if datasize is not None and datasize != len(data):
+        if datasize is not None and datasize != data.length:
             return '!%u!%s' % (datasize, data.hexdigest(sumtype))
 
         return data.hexdigest(sumtype)
commit a828573a879d1e3336b19b7a491fcdc43392f412
Author: James Antill <james at and.org>
Date:   Fri Feb 18 12:28:58 2011 -0500

    Add workaround for rhnplugin repos. setup, BZ 678043.

diff --git a/yum/__init__.py b/yum/__init__.py
index a3a1b02..4d185ff 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -574,6 +574,11 @@ class YumBase(depsolve.Depsolve):
 
             self.getReposFromConfig()
 
+        #  For rhnplugin, and in theory other stuff, calling
+        # .getReposFromConfig() recurses back into this function but only once.
+        # This means that we have two points on the stack leaving the above call
+        # but only one of them can do the repos setup. BZ 678043.
+        if hasattr(self, 'prerepoconf'):
             # Recursion
             prerepoconf = self.prerepoconf
             del self.prerepoconf
commit 7b2121b6687fbcd1dfb7c3496bbe4b0ef89f256f
Author: James Antill <james at and.org>
Date:   Tue Feb 15 10:43:03 2011 -0500

     Fix printing the obsoleters message, BZ 677666.
    
     Happened due to the cleanup in
    94d742bf395cc565cf3a0dca138608a9296b1303 giving us a bad "continue".

diff --git a/yum/__init__.py b/yum/__init__.py
index e395cc5..a3a1b02 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3430,7 +3430,6 @@ class YumBase(depsolve.Depsolve):
                 pkgs = po.obsoletedBy(pkgs, limit=1)
                 if pkgs:
                     already_obs = pkgs[0]
-                    continue
 
                 if already_obs:
                     self.verbose_logger.warning(_('Package %s is obsoleted by %s which is already installed'), 


More information about the Yum-commits mailing list