[yum-cvs] 2 commits - yum/depsolve.py

Jeremy Katz katzj at linux.duke.edu
Sat Aug 25 02:12:21 UTC 2007


 yum/depsolve.py |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

New commits:
commit b1ebeb90a893a034fc9decae456335ec1ec7d137
Author: Jeremy Katz <katzj at redhat.com>
Date:   Fri Aug 24 20:42:26 2007 -0400

    if we have two versions of a package and a compat package available in our
    repo, we can set the old version to be installed first, then the new one
    replaces the old one.  but we never go back and check for what required
    the provides of the old one and get something else (like the compat package)

diff --git a/yum/depsolve.py b/yum/depsolve.py
index c1d53c4..57933cb 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -407,7 +407,8 @@ class Depsolve(object):
         (needname, needflags, needversion) = requirement
         checkdeps = 0
         missingdep = 0
-        
+        upgraded = {}
+
         #~ - if it's not available from some repository:
         #~     - mark as unresolveable.
         #
@@ -442,7 +443,7 @@ class Depsolve(object):
             # installed or in the ts, and this isn't a package that allows multiple installs
             # then if it's newer, fine - continue on, if not, then we're unresolveable
             # cite it and exit
-        
+
             tspkgs = []
             if not self.allowedMultipleInstalls(pkg):
                 # from ts
@@ -453,6 +454,8 @@ class Depsolve(object):
                         self.verbose_logger.log(logginglevels.DEBUG_2, msg)
                         provSack.delPackage(pkg)
                         continue
+                    elif tspkg.po.EVR < pkg.EVR:
+                        upgraded.setdefault(pkg.pkgtup, []).append(tspkg.pkgtup)
                 
                 # from rpmdb
                 dbpkgs = self.rpmdb.searchNevra(name=pkg.name, arch=pkg.arch)
@@ -552,6 +555,12 @@ class Depsolve(object):
             txmbr = self.tsInfo.addInstall(best)
             txmbr.setAsDep()
 
+            # if we had other packages with this name.arch that we found
+            # before, they're not going to be installed anymore, so we
+            # should mark them to be re-checked
+            if upgraded.has_key(best.pkgtup):
+                map(lambda x: self.tsInfo.remove(x), upgraded[best.pkgtup])
+
         checkdeps = 1
         
         return checkdeps, missingdep
commit 0af9910e9813d67539aae32edb97a5fd11e64c1d
Author: Jeremy Katz <katzj at redhat.com>
Date:   Fri Aug 24 18:17:01 2007 -0400

    fix depchecking on members removed from the ts

diff --git a/yum/depsolve.py b/yum/depsolve.py
index e5d55b7..c1d53c4 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -759,7 +759,9 @@ class Depsolve(object):
         CheckDeps = False
         CheckInstalls = False
         CheckRemoves = False
-        for txmbr in self.tsInfo.getMembers() + self.tsInfo.getRemovedMembers():
+        # we need to check the opposite of install and remove for regular
+        # tsInfo members vs removed members
+        for (txmbr, inst, rem) in map(lambda x: (x, TS_INSTALL_STATES, TS_REMOVE_STATES), self.tsInfo.getMembers()) + map(lambda x: (x, TS_REMOVE_STATES, TS_INSTALL_STATES), self.tsInfo.getRemovedMembers()):
             if (self._dcobj.already_seen_removed.has_key(txmbr) or
                 (txmbr.ts_state is not None and self._dcobj.already_seen.has_key(txmbr))):
                 continue
@@ -769,10 +771,10 @@ class Depsolve(object):
             self.verbose_logger.log(logginglevels.DEBUG_2,
                                     "Checking deps for %s" %(txmbr,))
 
-            if txmbr.output_state in TS_INSTALL_STATES:
+            if txmbr.output_state in inst:
                 thisneeds = self._checkInstall(txmbr)
                 CheckInstalls = True
-            elif txmbr.output_state in TS_REMOVE_STATES:
+            elif txmbr.output_state in rem:
                 thisneeds = self._checkRemove(txmbr)
                 CheckRemoves = True
 



More information about the Yum-cvs-commits mailing list