If a dependency is installed but masked, try to pull in an unmasked version
authorZac Medico <zmedico@gentoo.org>
Fri, 21 May 2010 02:00:15 +0000 (19:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 May 2010 02:00:15 +0000 (19:00 -0700)
even when --deep is not specified. Thanks to Daniel Robbins for reporting.

pym/_emerge/depgraph.py

index d7f42c9164a784db6ad855a21ff112ef8f0d338d..a9ef729956537ae1c8d0a8c8b9dd100162b16559 100644 (file)
@@ -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,