Make the non --update package selection logic avoid installed packages if
authorZac Medico <zmedico@gentoo.org>
Fri, 21 May 2010 00:09:06 +0000 (17:09 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 May 2010 00:09:06 +0000 (17:09 -0700)
they are masked. Thanks to Daniel Robbins for reporting.

pym/_emerge/depgraph.py

index c102a7a2df40ad8530c25ea7ffd9011f47a064eb..d7f42c9164a784db6ad855a21ff112ef8f0d338d 100644 (file)
@@ -2719,7 +2719,11 @@ class depgraph(object):
                                                return pkg, existing_node
 
                        bestmatch = portage.best(
-                               [pkg.cpv for pkg in matched_packages])
+                               [pkg.cpv for pkg in matched_packages if pkg.visible])
+                       if not bestmatch:
+                               # all are masked, so ignore visibility
+                               bestmatch = portage.best(
+                                       [pkg.cpv for pkg in matched_packages])
                        matched_packages = [pkg for pkg in matched_packages \
                                if portage.dep.cpvequal(pkg.cpv, bestmatch)]