diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-09-14 22:09:04 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-14 22:09:04 -0700 |
commit | 70e7107bfb01225c0aac74ce32f66b1c3b0d4d2d (patch) | |
tree | 69d341ddb56c348814dcb239ef5a89af84d08c30 /pym/_emerge/depgraph.py | |
parent | a5e7c15b03a9c6982f28ad2460261c98fe35889b (diff) | |
download | portage-70e7107bfb01225c0aac74ce32f66b1c3b0d4d2d.tar.gz portage-70e7107bfb01225c0aac74ce32f66b1c3b0d4d2d.tar.bz2 portage-70e7107bfb01225c0aac74ce32f66b1c3b0d4d2d.zip |
Fix multislot handling for depclean (bug #382823)
Diffstat (limited to 'pym/_emerge/depgraph.py')
-rw-r--r-- | pym/_emerge/depgraph.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 1e311e8f7..f25a22dea 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3263,11 +3263,20 @@ class depgraph(object): # satisfied rather than forcing a rebuild. installed = pkg_type == 'installed' if installed and not cpv_list and atom.slot: + + if "remove" in self._dynamic_config.myparams: + # We need to search the portdbapi, which is not in our + # normal dbs list, in order to find the real SLOT. + portdb = self._frozen_config.trees[root_config.root]["porttree"].dbapi + db_keys = list(portdb._aux_cache_keys) + dbs = [(portdb, "ebuild", False, False, db_keys)] + else: + dbs = self._dynamic_config._filtered_trees[root_config.root]["dbs"] + for cpv in db.match(atom.cp): slot_available = False for other_db, other_type, other_built, \ - other_installed, other_keys in \ - self._dynamic_config._filtered_trees[root_config.root]["dbs"]: + other_installed, other_keys in dbs: try: if atom.slot == \ other_db.aux_get(cpv, ["SLOT"])[0]: @@ -4064,11 +4073,12 @@ class depgraph(object): """ Select packages that are installed. """ - vardb = self._dynamic_config._graph_trees[root]["vartree"].dbapi - matches = vardb.match_pkgs(atom) + matches = list(self._iter_match_pkgs(self._frozen_config.roots[root], + "installed", atom)) if not matches: return None, None if len(matches) > 1: + matches.reverse() # ascending order unmasked = [pkg for pkg in matches if \ self._pkg_visibility_check(pkg)] if unmasked: |