summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-02 01:52:02 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-02 02:06:05 -0800
commit3b8f3caf37171dea4193ecd6d6d7f243d6dbc5cd (patch)
tree81b291bf7e6a8df58cd85f19ac8cc4a210956ebd
parentFilter QA warning for --disable-dependency-tracking configure option. (diff)
downloadportage-3b8f3caf37171dea4193ecd6d6d7f243d6dbc5cd.tar.gz
portage-3b8f3caf37171dea4193ecd6d6d7f243d6dbc5cd.tar.bz2
portage-3b8f3caf37171dea4193ecd6d6d7f243d6dbc5cd.zip
depclean: account for more masks
Account for packages with masks (like KEYWORDS masks) that are usually ignored in visibility checks for installed packages, in order to handle cases like bug #350285.
-rw-r--r--pym/_emerge/depgraph.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7e8cd2bef..71d6746a0 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3210,6 +3210,20 @@ class depgraph(object):
matches = vardb.match_pkgs(atom)
if not matches:
return None, None
+ if len(matches) > 1:
+ unmasked = [pkg for pkg in matches if \
+ self._pkg_visibility_check(pkg)]
+ if unmasked:
+ if len(unmasked) == 1:
+ matches = unmasked
+ else:
+ # Account for packages with masks (like KEYWORDS masks)
+ # that are usually ignored in visibility checks for
+ # installed packages, in order to handle cases like
+ # bug #350285.
+ unmasked = [pkg for pkg in matches if not pkg.masks]
+ if unmasked:
+ matches = unmasked
pkg = matches[-1] # highest match
in_graph = self._dynamic_config._slot_pkg_map[root].get(pkg.slot_atom)
return pkg, in_graph