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

skvidal at osuosl.org skvidal at osuosl.org
Thu Oct 8 13:39:12 UTC 2009


 yum/__init__.py |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 18a96e276581f5fb8ada14667cf8e200e2b6d9e8
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Oct 8 09:38:42 2009 -0400

    change method name to _does_this_update()
    update docstring

diff --git a/yum/__init__.py b/yum/__init__.py
index e2bf595..daa437f 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3158,7 +3158,7 @@ class YumBase(depsolve.Depsolve):
         for txmbr in tx_return:
             for i_pkg in self.rpmdb.searchNevra(name=txmbr.name):
                 if i_pkg not in txmbr.updates:
-                    if self.does_this_update(txmbr.po, i_pkg):
+                    if self._does_this_update(txmbr.po, i_pkg):
                         self.tsInfo.addUpdated(i_pkg, txmbr.po)
                         
         return tx_return
@@ -4144,8 +4144,10 @@ class YumBase(depsolve.Depsolve):
 
         return True # We got a new cache dir
 
-    def does_this_update(self, pkg1, pkg2):
-        """returns True if pkg1 can update pkg2, False if not"""
+    def _does_this_update(self, pkg1, pkg2):
+        """returns True if pkg1 can update pkg2, False if not. 
+           This only checks if it can be an update it does not check if
+           it is obsoleting or anything else."""
         
         if pkg1.name != pkg2.name:
             return False
commit 42c6216e9b9315db20ba2dd998dc33c6ed867389
Merge: 8faa36a... c12018d...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Oct 8 09:35:38 2009 -0400

    Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
    
    * 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
      updated pt_BR translation by Igor Pires Soares
      updated fr translation by Michel Duquaine
      skipbroken: make the missing obsoleted check don't scan all transaction member, but only the TS_OBSOLETING, TS_OBSOLETED ones

commit 8faa36a9753814c7d50c75197b66e69ca6938dba
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Oct 7 16:49:51 2009 -0400

    fix up the naming of the new method to make it less studlycaps'd

diff --git a/yum/__init__.py b/yum/__init__.py
index 1dc1022..e2bf595 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3158,7 +3158,7 @@ class YumBase(depsolve.Depsolve):
         for txmbr in tx_return:
             for i_pkg in self.rpmdb.searchNevra(name=txmbr.name):
                 if i_pkg not in txmbr.updates:
-                    if self.doesthisUpdate(txmbr.po, i_pkg):
+                    if self.does_this_update(txmbr.po, i_pkg):
                         self.tsInfo.addUpdated(i_pkg, txmbr.po)
                         
         return tx_return
@@ -4144,7 +4144,7 @@ class YumBase(depsolve.Depsolve):
 
         return True # We got a new cache dir
 
-    def doesthisUpdate(self, pkg1, pkg2):
+    def does_this_update(self, pkg1, pkg2):
         """returns True if pkg1 can update pkg2, False if not"""
         
         if pkg1.name != pkg2.name:
commit 36863bf4a9d3a1851f9ae45a0cd7eb4894345f3b
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Oct 7 16:34:04 2009 -0400

    if we have some duplicate installed pkgs that do not conflict and we update for the newer one
    but something deps on the older one. We shouldn't fail against the rpm tscheck, we should fail
    well before then.
    
    This adds 'YumBase.doesThisUpdate(pkg1, pkg2)' which lets this check take less time.

diff --git a/yum/__init__.py b/yum/__init__.py
index 79383a5..1dc1022 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3154,7 +3154,13 @@ class YumBase(depsolve.Depsolve):
                 elif ipkg.verLT(available_pkg):
                     txmbr = self._add_up_txmbr(requiringPo, available_pkg, ipkg)
                     tx_return.append(txmbr)
-
+        
+        for txmbr in tx_return:
+            for i_pkg in self.rpmdb.searchNevra(name=txmbr.name):
+                if i_pkg not in txmbr.updates:
+                    if self.doesthisUpdate(txmbr.po, i_pkg):
+                        self.tsInfo.addUpdated(i_pkg, txmbr.po)
+                        
         return tx_return
         
     def remove(self, po=None, **kwargs):
@@ -4138,3 +4144,18 @@ class YumBase(depsolve.Depsolve):
 
         return True # We got a new cache dir
 
+    def doesthisUpdate(self, pkg1, pkg2):
+        """returns True if pkg1 can update pkg2, False if not"""
+        
+        if pkg1.name != pkg2.name:
+            return False
+        if not pkg1.EVR  > pkg2.EVR:
+            return False
+        if pkg1.arch not in self.arch.archlist:
+            return False
+        if rpmUtils.arch.canCoinstall(pkg1.arch, pkg2.arch):
+            return False
+        if self.allowedMultipleInstalls(pkg1):
+            return False
+            
+        return True    


More information about the Yum-commits mailing list