From 5b55465077a5b65cf7fb4f9995c8389ce24526db Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 20 May 2010 19:00:15 -0700 Subject: [PATCH] If a dependency is installed but masked, try to pull in an unmasked version even when --deep is not specified. Thanks to Daniel Robbins for reporting. --- pym/_emerge/depgraph.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index d7f42c916..a9ef72995 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -834,6 +834,7 @@ class depgraph(object): # discarded dependencies reduce the amount of information # available for optimization of merge order. if dep.priority.satisfied and \ + dep.priority.satisfied.visible and \ not dep_pkg.installed and \ not (existing_node or recurse): myarg = None @@ -1286,8 +1287,17 @@ class depgraph(object): continue mypriority = dep_priority.copy() - if not atom.blocker and vardb.match(atom): - mypriority.satisfied = True + if not atom.blocker: + inst_pkgs = vardb.match_pkgs(atom) + if inst_pkgs: + for inst_pkg in inst_pkgs: + if inst_pkg.visible: + # highest visible + mypriority.satisfied = inst_pkg + break + if not mypriority.satisfied: + # none visible, so use highest + mypriority.satisfied = inst_pkgs[0] if not self._add_dep(Dependency(atom=atom, blocker=atom.blocker, child=child, depth=depth, parent=pkg, @@ -1323,8 +1333,17 @@ class depgraph(object): pkg, self._priority(runtime=True), root_config, atoms): # This is a GLEP 37 virtual, so its deps are all runtime. mypriority = self._priority(runtime=True) - if not atom.blocker and vardb.match(atom): - mypriority.satisfied = True + if not atom.blocker: + inst_pkgs = vardb.match_pkgs(atom) + if inst_pkgs: + for inst_pkg in inst_pkgs: + if inst_pkg.visible: + # highest visible + mypriority.satisfied = inst_pkg + break + if not mypriority.satisfied: + # none visible, so use highest + mypriority.satisfied = inst_pkgs[0] if not self._add_dep(Dependency(atom=atom, blocker=atom.blocker, child=child, depth=virt_pkg.depth, -- 2.26.2