For bugs #197810 and #215308, pass the depgraph's "selective" parameter
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Mar 2008 00:55:46 +0000 (00:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Mar 2008 00:55:46 +0000 (00:55 -0000)
down into dep_check() for better atom preference selection when handling
virtuals and other disjunctive || dependencies.

svn path=/main/branches/2.1.2/; revision=9610

bin/emerge
pym/portage.py

index b3a8d25f3fa9271b2228df624155356a740596c2..7c79c922a86481f9d26def1423f742296cfb542b 100755 (executable)
@@ -2424,6 +2424,7 @@ class depgraph:
                                mymerge = []
                else:
                        try:
+                               self.trees[myroot]["selective"] = "selective" in self.myparams
                                if myparent and p_status == "nomerge":
                                        portage_dep._dep_check_strict = False
                                mycheck = portage.dep_check(depstring, None,
@@ -2431,6 +2432,7 @@ class depgraph:
                                        use_binaries=("--usepkgonly" in self.myopts),
                                        myroot=myroot, trees=self.trees)
                        finally:
+                               self.trees[myroot]["selective"] = False
                                portage_dep._dep_check_strict = True
 
                        if not mycheck[0]:
index 2cbc2ef076d7ce1eed25465f118a48c3d74ec876..7db532787d780231b3d1fa1bc1cfbe10ca0080d0 100644 (file)
@@ -5290,6 +5290,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
        if trees is None:
                global db
                trees = db
+       selective = trees[myroot].get("selective", False)
        writemsg("ZapDeps -- %s\n" % (use_binaries), 2)
        if not reduced or unreduced == ["||"] or dep_eval(reduced):
                return []
@@ -5353,7 +5354,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                has_mask = False
                                if hasattr(mydbapi, "xmatch"):
                                        has_mask = bool(mydbapi.xmatch("match-all", atom))
-                               if (use_binaries or not has_mask):
+                               if (selective or use_binaries or not has_mask):
                                        avail_pkg = best(vardb.match(atom))
                                        if avail_pkg:
                                                avail_slot = "%s:%s" % (dep_getkey(atom),