summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-03 01:40:42 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-03 01:40:42 +0000
commitee08ab1b90122200a79cf1ce89863b190872f856 (patch)
treeca45882eaa73424592162009ce809134376dc338
parentf9c6f66ba40881060ab0e8acb1e3f95ed2e52483 (diff)
downloadportage-ee08ab1b90122200a79cf1ce89863b190872f856.tar.gz
portage-ee08ab1b90122200a79cf1ce89863b190872f856.tar.bz2
portage-ee08ab1b90122200a79cf1ce89863b190872f856.zip
In depgraph.altlist(), use a recursive fuction to gather groups of nodes that RDEPEND on eachother.
svn path=/main/trunk/; revision=4576
-rwxr-xr-xbin/emerge21
1 files changed, 9 insertions, 12 deletions
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:"