[yum-commits] Branch 'yum-3_2_X' - 5 commits - rpmUtils/miscutils.py yum/__init__.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Aug 12 18:56:53 UTC 2009


 rpmUtils/miscutils.py |    6 +++++-
 yum/__init__.py       |   32 ++++++++++++++++++++++++++------
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit 0dfc1290daeb98e7c434be48d1fb0e9584346324
Merge: a3d1d8d... 7eaae63...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Aug 12 14:55:02 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:
      Cleanup whitespace for repolist -v
      Add expire data to repolist -v
      Fix the Fedora repo. id for rawhide, in i18n post install tests.
      Fix the previous testcase, by:
      Testcase to make sure a specifc nevra comes out of _compare_providers()

commit a3d1d8d1aa37c6356674756becef989ad7936df4
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Aug 12 14:54:24 2009 -0400

    additional LT/LE cases - fleshing them out a bit more

diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
index d76f3a8..a925027 100644
--- a/rpmUtils/miscutils.py
+++ b/rpmUtils/miscutils.py
@@ -174,13 +174,11 @@ def rangeCompare(reqtuple, provtuple):
             return 1
         if reqf in ['EQ', 8]:
             if f in ['LE', 10, 'LT', 2]:
+                return 1                
+        if reqf in ['LE', 'LT', 'EQ', 10, 2, 8]:
+            if f in ['LE', 'LT', 10, 2]:
                 return 1
-        # there is more to be done here to make sure it is right
-        # my brain melted trying to map these- skvidal 8/11/2009
-        if reqf in ['LT', 2]:
-            if f in ['LT', 2]:
-                return 1
-        
+
     if rc == 0:
         if reqf in ['GT', 4]:
             if f in ['GT', 'GE', 4, 12]:
commit 9f5dd6d547a30b8464c3448ae56ef34fcc0f34fc
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Aug 12 14:54:04 2009 -0400

    add comment about other weird obsoletes cases

diff --git a/yum/__init__.py b/yum/__init__.py
index 2585901..0df32a3 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3230,6 +3230,12 @@ class YumBase(depsolve.Depsolve):
             self.verbose_logger.log(logginglevels.INFO_2,
                 _('%s: does not update installed package.'), po.localpath)
         
+        # this checks to make sure that any of the to-be-installed pkgs
+        # does not obsolete something else that's installed
+        # this doesn't handle the localpkgs obsoleting EACH OTHER or
+        # anything else in the transaction set, though. That could/should
+        # be fixed later but a fair bit of that is a pebkac and should be
+        # said as "don't do that". potential 'fixme'
         for txmbr in tx_return:
             if txmbr.po.obsoletes:
                 for obs_pkg in self._find_obsoletees(txmbr.po):
commit 1261479f334019c30900573cc10f9d2c8d9031e2
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Aug 11 16:53:58 2009 -0400

    fix in rangeCompare for where the item we're comparing it to has LESS than range
    for example: if e-1.0-0 in the range of E < 1.1
    
    There are probably more typeso f insanity here - and some more tests to define and I commented
    about that in the code.

diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
index f494fc3..d76f3a8 100644
--- a/rpmUtils/miscutils.py
+++ b/rpmUtils/miscutils.py
@@ -173,8 +173,14 @@ def rangeCompare(reqtuple, provtuple):
         if reqf in ['GT', 'GE', 4, 12]:
             return 1
         if reqf in ['EQ', 8]:
-            if f in ['LE', 10]:
+            if f in ['LE', 10, 'LT', 2]:
                 return 1
+        # there is more to be done here to make sure it is right
+        # my brain melted trying to map these- skvidal 8/11/2009
+        if reqf in ['LT', 2]:
+            if f in ['LT', 2]:
+                return 1
+        
     if rc == 0:
         if reqf in ['GT', 4]:
             if f in ['GT', 'GE', 4, 12]:
commit f585fe7741cd96dd57d3140d0b5878596e2bd73b
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Aug 11 16:52:19 2009 -0400

    make sure obsoletes are looked up for localinstall/updated pkgs
    this handles the cases where the localpkg is a proper update AND an obsolete
    for a different installed pkg.

diff --git a/yum/__init__.py b/yum/__init__.py
index 9930c08..2585901 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2586,10 +2586,18 @@ class YumBase(depsolve.Depsolve):
 
     def _find_obsoletees(self, po):
         """ Return the pkgs. that are obsoleted by the po we pass in. """
-        for (obstup, inst_tup) in self.up.getObsoletersTuples(name=po.name):
-            if po.pkgtup == obstup:
-                installed_pkg =  self.rpmdb.searchPkgTuple(inst_tup)[0]
-                yield installed_pkg
+        if not isinstance(po, YumLocalPackage):
+            for (obstup, inst_tup) in self.up.getObsoletersTuples(name=po.name):
+                if po.pkgtup == obstup:
+                    installed_pkg =  self.rpmdb.searchPkgTuple(inst_tup)[0]
+                    yield installed_pkg
+        else:
+            for (obs_n, obs_f, (obs_e, obs_v, obs_r)) in po.obsoletes:
+                for pkg in self.rpmdb.searchNevra(name=obs_n):
+                    installedtup = (pkg.name, 'EQ', (pkg.epoch, 
+                                   pkg.ver, pkg.release))
+                    if po.inPrcoRange('obsoletes', installedtup):
+                        yield pkg
 
     def _add_prob_flags(self, *flags):
         """ Add all of the passed flags to the tsInfo.probFilterFlags array. """
@@ -3139,7 +3147,6 @@ class YumBase(depsolve.Depsolve):
         # append it to self.localPackages
         # check if it can be installed or updated based on nevra versus rpmdb
         # don't import the repos until we absolutely need them for depsolving
-
         tx_return = []
         installpkgs = []
         updatepkgs = []
@@ -3222,7 +3229,14 @@ class YumBase(depsolve.Depsolve):
         for po in donothingpkgs:
             self.verbose_logger.log(logginglevels.INFO_2,
                 _('%s: does not update installed package.'), po.localpath)
-
+        
+        for txmbr in tx_return:
+            if txmbr.po.obsoletes:
+                for obs_pkg in self._find_obsoletees(txmbr.po):
+                    self.tsInfo.addObsoleted(obs_pkg, txmbr.po)
+                    txmbr.obsoletes.append(obs_pkg)
+                    self.tsInfo.addObsoleting(txmbr.po,obs_pkg)
+                
         return tx_return
 
     def reinstallLocal(self, pkg, po=None):


More information about the Yum-commits mailing list