[yum-commits] 4 commits - test/testbase.py yumcommands.py yum/__init__.py

James Antill james at osuosl.org
Wed Mar 14 18:36:10 UTC 2012


 test/testbase.py |    2 ++
 yum/__init__.py  |   44 ++++++++++++++++++++++++++++++++++++++------
 yumcommands.py   |    2 +-
 3 files changed, 41 insertions(+), 7 deletions(-)

New commits:
commit 23f54bb3f20c913f2eb7495653cd82d694ee253c
Author: James Antill <james at and.org>
Date:   Wed Mar 14 14:33:10 2012 -0400

    Fix gaftonmode by adding a layer of indirection. BZ 803448.

diff --git a/yum/__init__.py b/yum/__init__.py
index 7e84539..3680356 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -46,8 +46,13 @@ import operator
 import tempfile
 
 import yum.i18n
-_ = yum.i18n._
-P_ = yum.i18n.P_
+# This is required to make gaftonmode work...
+_wrap_yum_i18n__ = yum.i18n._
+def _(*args, **kwargs):
+    return _wrap_yum_i18n__(*args, **kwargs)
+_wrap_yum_i18n_P_ = yum.i18n.P_
+def P_(*args, **kwargs):
+    return _wrap_yum_i18n_P_(*args, **kwargs)
 
 import config
 from config import ParsingError, ConfigParser
@@ -334,8 +339,10 @@ class YumBase(depsolve.Depsolve):
             startupconf.uuid = uuid
         
         if startupconf.gaftonmode:
-            global _
-            _ = yum.i18n.dummy_wrapper
+            global _wrap_yum_i18n__
+            _wrap_yum_i18n__ = yum.i18n.dummy_wrapper
+            global _wrap_yum_i18n_P_
+            _wrap_yum_i18n_P_ = yum.i18n.dummyP_wrapper
 
         if debuglevel != None:
             startupconf.debuglevel = debuglevel
commit 60f3b2c5f443e841d1c3ba195619226ee7d38938
Author: James Antill <james at and.org>
Date:   Mon Mar 12 15:50:02 2012 -0400

    Change command output loglevel from INFO to INFO_2, BZ 750859.

diff --git a/yumcommands.py b/yumcommands.py
index bb4dde8..9c181ec 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -218,7 +218,7 @@ class YumCommand:
         :param *args: additional arguments associated with the message
         """
         if not self.done_command_once:
-            base.verbose_logger.info(msg, *args)
+            base.verbose_logger.info(logginglevels.INFO_2, msg, *args)
         self.done_command_once = True
 
     def getNames(self):
commit 7eac40444da7d42b51a457a944ce28348b9b12b0
Author: James Antill <james at and.org>
Date:   Tue Mar 6 12:04:36 2012 -0500

    Check for a compat. arch. as well, when hand testing for upgradability.

diff --git a/yum/__init__.py b/yum/__init__.py
index 99a30e1..7e84539 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3985,6 +3985,31 @@ class YumBase(depsolve.Depsolve):
             if flag not in self.tsInfo.probFilterFlags:
                 self.tsInfo.probFilterFlags.append(flag)
 
+    def _install_is_upgrade(self, po, ipkgs):
+        """ See if po is an upgradeable version of an installed pkg.
+        Non-compat. arch differences mean no. """
+
+        if False and self._up is not None:
+            #  This is the old code, not sure it's good to have two paths. And
+            # we don't wnat to create .up. (which requires init repos.) if we
+            # don't have to.
+            return po.pkgtup in self.up.updating_dict
+
+        for ipkg in ipkgs:
+            if po.verLE(ipkg):
+                continue
+            if po.arch == ipkg.arch: # always fine.
+                return True
+            if 'noarch' in (po.arch, ipkg.arch):
+                return True
+            if not self.arch.multilib:
+                return True
+            if canCoinstall(po.arch, ipkg.arch):
+                continue
+            return True
+
+        return False
+
     def install(self, po=None, **kwargs):
         """Mark the specified item for installation.  If a package
         object is given, mark it for installation.  Otherwise, mark
@@ -4140,7 +4165,7 @@ class YumBase(depsolve.Depsolve):
             
             # make sure this shouldn't be passed to update:
             ipkgs = self.rpmdb.searchNames([po.name])
-            if ipkgs and po.verGT(sorted(ipkgs)[-1]):
+            if ipkgs and self._install_is_upgrade(po, ipkgs):
                 txmbrs = self.update(po=po)
                 tx_return.extend(txmbrs)
                 continue
commit 6015099ba3917fdb4f50f874a42a741c03b252d4
Author: James Antill <james at and.org>
Date:   Mon Mar 5 17:04:37 2012 -0500

    Fix test_loop, previously it always failed the first obs. chain. BZ 800016

diff --git a/test/testbase.py b/test/testbase.py
index c185a7f..0a931f1 100644
--- a/test/testbase.py
+++ b/test/testbase.py
@@ -56,6 +56,8 @@ class FakeConf(object):
         self.protected_multilib = False
         self.clean_requirements_on_remove = True
         self.upgrade_requirements_on_install = False
+        self.recheck_installed_requires = False
+        self.group_command = 'compat'
 
 class FakeSack:
     """ Fake PackageSack to use with FakeRepository"""
diff --git a/yum/__init__.py b/yum/__init__.py
index eb946d9..99a30e1 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3894,7 +3894,7 @@ class YumBase(depsolve.Depsolve):
             done = True
 
             slow = next_func(slow)
-            if next == slow:
+            if node == slow:
                 return None
 
     def _at_groupinstall(self, pattern, upgrade=False):


More information about the Yum-commits mailing list