summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-11 02:05:51 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-11 02:05:51 -0700
commitadde8a45e2f82adcc12cb146ccc65774d5783bf2 (patch)
tree5d4a5162bdc88c17a0fc540eb079c817cd28d55d
parent7ec9999cd3c06f66655091be465471973b52b1dd (diff)
downloadportage-adde8a45e2f82adcc12cb146ccc65774d5783bf2.tar.gz
portage-adde8a45e2f82adcc12cb146ccc65774d5783bf2.tar.bz2
portage-adde8a45e2f82adcc12cb146ccc65774d5783bf2.zip
serialize_tasks: minimize runtime cycles more
-rw-r--r--pym/_emerge/depgraph.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 5dda22246..854fa63fb 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5015,6 +5015,7 @@ class depgraph(object):
# this tends to produce a more optimal merge order.
# Ignoring all medium_soft deps serves this purpose.
ignore_priority = priority_range.ignore_medium_soft
+ smallest_cycle = None
for node in nodes:
if not mygraph.parent_nodes(node):
continue
@@ -5037,9 +5038,11 @@ class depgraph(object):
selected_nodes = None
break
if selected_nodes:
- break
- else:
- selected_nodes = None
+ if smallest_cycle is None or \
+ len(selected_nodes) < len(smallest_cycle):
+ smallest_cycle = selected_nodes
+
+ selected_nodes = smallest_cycle
if prefer_asap and asap_nodes and not selected_nodes:
# We failed to find any asap nodes to merge, so ignore