summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-11 08:51:24 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-11 08:51:24 -0700
commitda1556b818de2829fc72700a15a12424ccf32f16 (patch)
tree7df50b318c5a6e46eed4737c08f3f12e02f26ad7
parentadde8a45e2f82adcc12cb146ccc65774d5783bf2 (diff)
downloadportage-da1556b818de2829fc72700a15a12424ccf32f16.tar.gz
portage-da1556b818de2829fc72700a15a12424ccf32f16.tar.bz2
portage-da1556b818de2829fc72700a15a12424ccf32f16.zip
serialize_tasks: asap ignore medium_soft earlier
This allows us to avoid the less efficient runtime cycle pathway for cases in which an asap node is a leaf if medium_soft deps are ignored. Ths should increase efficiency without changing behavior.
-rw-r--r--pym/_emerge/depgraph.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 854fa63fb..37dde2d81 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4940,12 +4940,18 @@ class depgraph(object):
# the parent to have been removed from the graph already.
asap_nodes = [node for node in asap_nodes \
if mygraph.contains(node)]
- for node in asap_nodes:
- if not mygraph.child_nodes(node,
- ignore_priority=priority_range.ignore_soft):
- selected_nodes = [node]
- asap_nodes.remove(node)
+ for i in range(priority_range.SOFT,
+ priority_range.MEDIUM_SOFT + 1):
+ ignore_priority = priority_range.ignore_priority[i]
+ for node in asap_nodes:
+ if not mygraph.child_nodes(node,
+ ignore_priority=ignore_priority):
+ selected_nodes = [node]
+ asap_nodes.remove(node)
+ break
+ if selected_nodes:
break
+
if not selected_nodes and \
not (prefer_asap and asap_nodes):
for i in range(priority_range.NONE,