From: Zac Medico Date: Tue, 3 Oct 2006 01:40:42 +0000 (-0000) Subject: In depgraph.altlist(), use a recursive fuction to gather groups of nodes that RDEPEND... X-Git-Tag: v2.1.2~728 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee08ab1b90122200a79cf1ce89863b190872f856;p=portage.git In depgraph.altlist(), use a recursive fuction to gather groups of nodes that RDEPEND on eachother. svn path=/main/trunk/; revision=4576 --- diff --git a/bin/emerge b/bin/emerge index d34f395c7..dd3461be0 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1279,21 +1279,18 @@ class depgraph: if ignore_priority <= digraph.SOFT or len(nodes) == 1: selected_nodes = [nodes[0]] else: - """Find two or more nodes that are mutually dependent and - completely satisfy eachother's non-soft deps.""" - selected_nodes = None - for node in nodes: - selected_nodes = set(mygraph.child_nodes(node, - ignore_priority=digraph.SOFT)) + """Recursively gather a group of nodes that RDEPEND on + eachother. This ensures that they are merged as a group + and get their RDEPENDs satisfied as soon as possible.""" + selected_nodes = set() + def gather_deps(node): + if node in selected_nodes: + return selected_nodes.add(node) - grandchildren = set() for child in mygraph.child_nodes(node, ignore_priority=digraph.SOFT): - grandchildren.update(mygraph.child_nodes(child, - ignore_priority=digraph.SOFT)) - if grandchildren.issubset(selected_nodes): - break - selected_nodes = None + gather_deps(child) + gather_deps(nodes[0]) if not selected_nodes: print "!!! Error: circular dependencies:"