diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-03-30 02:13:19 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-03-30 02:13:19 +0000 |
commit | bb85dfca12bec291d8a982aca48ea144469ff1cc (patch) | |
tree | fc6ad04d8f7e2065806f9b2829999b3e962a147b | |
parent | d2675594af53ee4ee7e23e69357335e96c2fa6e7 (diff) | |
download | portage-bb85dfca12bec291d8a982aca48ea144469ff1cc.tar.gz portage-bb85dfca12bec291d8a982aca48ea144469ff1cc.tar.bz2 portage-bb85dfca12bec291d8a982aca48ea144469ff1cc.zip |
For bugs #197810 and #215308, pass the depgraph's "selective" parameter
down into dep_check() for better atom preference selection when handling
virtuals and other disjunctive || dependencies. (branches/2.1.2 r9610)
svn path=/main/trunk/; revision=9611
-rw-r--r-- | pym/_emerge/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/__init__.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d03a2eacb..328b7f1e9 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2484,12 +2484,14 @@ class depgraph(object): myuse=myuse, strict=strict) if True: try: + self.trees[root]["selective"] = "selective" in self.myparams if not strict: portage.dep._dep_check_strict = False mycheck = portage.dep_check(depstring, None, pkgsettings, myuse=myuse, myroot=root, trees=trees) finally: + self.trees[root]["selective"] = False portage.dep._dep_check_strict = True if not mycheck[0]: raise portage.exception.InvalidDependString(mycheck[1]) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 745ecb38c..9407d2a90 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5315,6 +5315,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 [] @@ -5378,7 +5379,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), |