From: Zac Medico Date: Sat, 11 Jun 2011 03:58:38 +0000 (-0700) Subject: depgraph._serialize_tasks: move libperl/perl code X-Git-Tag: v2.2.0_alpha40~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=075ce106b3ae1e55cc810b4c946deea83bcb4a8e;p=portage.git depgraph._serialize_tasks: move libperl/perl code This ensures that all asap_nodes are explored before setting prefer_asap to False. --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index baa40c425..ca86904e6 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -5019,7 +5019,23 @@ class depgraph(object): selected_nodes = set() if gather_deps(ignore_priority, mergeable_nodes, selected_nodes, node): - break + # When selecting asap_nodes, we need to ensure + # that we don't selected a large runtime cycle + # that is obviously sub-optimal. This will be + # obvious if any of the non-asap selected_nodes + # is a leaf node when medium_soft deps are + # ignored. + if prefer_asap and asap_nodes and \ + len(selected_nodes) > 1: + for node in selected_nodes.difference( + asap_nodes): + if not mygraph.child_nodes(node, + ignore_priority = + DepPriorityNormalRange.ignore_medium_soft): + selected_nodes = None + break + if selected_nodes: + break else: selected_nodes = None if selected_nodes: @@ -5031,19 +5047,6 @@ class depgraph(object): # so ignore them for the next iteration. prefer_asap = False continue - # Make sure that we haven't selected a large runtime - # cycle that is obviously sub-optimal. This will be - # obvious if any of the non-asap selected_nodes is - # a leaf node when medium_soft deps are ignored. - if len(selected_nodes) > 1: - for node in selected_nodes.difference(asap_nodes): - if not mygraph.child_nodes(node, - ignore_priority = - DepPriorityNormalRange.ignore_medium_soft): - prefer_asap = False - break - if not prefer_asap: - continue if selected_nodes and ignore_priority is not None: # Try to merge ignored medium_soft deps as soon as possible