From: Zac Medico Date: Sat, 16 Feb 2008 23:46:29 +0000 (-0000) Subject: In the action_depclean() topological sort, only add packages to the X-Git-Tag: v2.2_pre3~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=45f8fe4af023c6a554fcf76c759ef035d60ccbdf;p=portage.git In the action_depclean() topological sort, only add packages to the graph if they are being removed. svn path=/main/trunk/; revision=9345 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index ec34daf62..90134d42e 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6588,8 +6588,10 @@ def action_depclean(settings, trees, ldpath_mtimes, # Create a new graph to account for dependencies between the # packages being unmerged. graph = digraph() - for node in cleanlist: - myaux = dict(izip(aux_keys, vardb.aux_get(pkg, aux_keys))) + clean_set = set(cleanlist) + del cleanlist[:] + for node in clean_set: + myaux = dict(izip(aux_keys, vardb.aux_get(node, aux_keys))) mydeps = [] usedef = vardb.aux_get(pkg, ["USE"])[0].split() for dep_type, depstr in myaux.iteritems(): @@ -6615,7 +6617,8 @@ def action_depclean(settings, trees, ldpath_mtimes, if not matches: continue for cpv in matches: - graph.add(cpv, node, priority=priority) + if cpv in clean_set: + graph.add(cpv, node, priority=priority) # Order nodes from lowest to highest overall reference count for # optimal root node selection. @@ -6626,8 +6629,6 @@ def action_depclean(settings, trees, ldpath_mtimes, return node_refcounts[node1] - node_refcounts[node2] graph.order.sort(cmp_reference_count) - clean_set = set(cleanlist) - del cleanlist[:] ignore_priority_range = [None] ignore_priority_range.extend( xrange(UnmergeDepPriority.MIN, UnmergeDepPriority.MAX + 1)) @@ -6645,8 +6646,7 @@ def action_depclean(settings, trees, ldpath_mtimes, del nodes[1:] for node in nodes: graph.remove(node) - if node in clean_set: - cleanlist.append(node) + cleanlist.append(node) unmerge(root_config, myopts, "unmerge", cleanlist, ldpath_mtimes)