[Yum-devel] [PATCH] A couple of minor opts for depsolving, in checkInstall and checkRemove

James Antill james at and.org
Wed Oct 28 21:39:05 UTC 2009


 checkInstall: Don't filter out requires that we provide, as it's done
at createrepo time now.

 checkRemove: If we have a req. we don't provide, check the things that
update/obsolete us for it first.
---
 yum/depsolve.py |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/yum/depsolve.py b/yum/depsolve.py
index 4d3d5ca..4c9ebd0 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -843,7 +843,6 @@ class Depsolve(object):
 
     def _checkInstall(self, txmbr):
         txmbr_reqs = txmbr.po.returnPrco('requires')
-        txmbr_provs = set(txmbr.po.returnPrco('provides'))
 
         # if this is an update, we should check what the old
         # requires were to make things faster
@@ -856,8 +855,6 @@ class Depsolve(object):
         for req in sorted(txmbr_reqs, key=self._sort_req_key):
             if req[0].startswith('rpmlib('):
                 continue
-            if req in txmbr_provs:
-                continue
             if req in oldreqs and self.rpmdb.getProvides(*req):
                 continue
             
@@ -884,7 +881,7 @@ class Depsolve(object):
         # if this is an update, we should check what the new package
         # provides to make things faster
         newpoprovs = {}
-        for newpo in txmbr.updated_by:
+        for newpo in txmbr.updated_by + txmbr.obsoleted_by:
             for p in newpo.provides:
                 newpoprovs[p] = 1
         ret = []
@@ -899,7 +896,22 @@ class Depsolve(object):
             # FIXME: This is probably the best place to fix the postfix rename
             # problem long term (post .21) ... see compare_providers.
             for pkg, hits in self.tsInfo.getRequires(*prov).iteritems():
-                for rn, rf, rv in hits:
+                for hit in hits:
+                    # See if the update solves the problem...
+                    found = False
+                    for newpo in txmbr.updated_by:
+                        if newpo.checkPrco('provides', hit):
+                            found = True
+                            break
+                    if found: continue
+                    for newpo in txmbr.obsoleted_by:
+                        if newpo.checkPrco('provides', hit):
+                            found = True
+                            break
+                    if found: continue
+
+                    # It doesn't, so see what else might...
+                    rn, rf, rv = hit
                     if not self.tsInfo.getProvides(rn, rf, rv):
                         ret.append( (pkg, self._prco_req_nfv2req(rn, rf, rv)) )
         return ret
-- 
1.6.2.5



More information about the Yum-devel mailing list