From 7962c0008ce24ea945b1ee38bcbd3096918d5dcc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 4 Mar 2007 00:34:25 +0000 Subject: [PATCH] For bug #169187, make --depclean prune unneeded slots such that it is consistent with the world update algorithm. svn path=/main/trunk/; revision=6160 --- pym/emerge/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 4078d9e29..cd96a6d3f 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -4658,6 +4658,8 @@ def action_depclean(settings, trees, ldpath_mtimes, dep_check_trees[myroot]["porttree"] = dep_check_trees[myroot]["vartree"] syslist = getlist(settings, "system") worldlist = getlist(settings, "world") + system_world_dict = genericdict(worldlist) + system_world_dict.update(genericdict(syslist)) fakedb = portage.fakedbapi(settings=settings) myvarlist = vardb.cpv_all() @@ -4694,8 +4696,12 @@ def action_depclean(settings, trees, ldpath_mtimes, if not atom.startswith("!") and priority == hard: unresolveable.setdefault(atom, []).append(parent) continue - # Could put slot checking here to ensure that there aren't two - # packages with the same slot... + if portage.dep_getkey(atom) not in system_world_dict: + # Prune all but the best matching slot, since that's all that a + # deep world update would pull in. Don't prune if the cpv is in + # system or world though, since those sets trigger greedy update + # of all slots. + pkgs = [portage.best(pkgs)] for pkg in pkgs: if fakedb.cpv_exists(pkg): continue -- 2.26.2