summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-10 16:24:54 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-10 16:24:54 -0700
commit603569311daee6e2460051f46728a05cbae66880 (patch)
tree7e506bc8d8394bd59e9fafacdf9a567a30628071
parent1aa05134750fc3639031c852824dac1c182a05dc (diff)
downloadportage-603569311daee6e2460051f46728a05cbae66880.tar.gz
portage-603569311daee6e2460051f46728a05cbae66880.tar.bz2
portage-603569311daee6e2460051f46728a05cbae66880.zip
depgraph._serialize_tasks: fix libperl/perl order
In some cases, the asap_nodes code caused selection of a large runtime cycle that was obviously sub-optimal. Now such cases are detected and avoided.
-rw-r--r--pym/_emerge/depgraph.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a00837f39..8e06aff38 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5025,11 +5025,23 @@ class depgraph(object):
if selected_nodes:
break
- if prefer_asap and asap_nodes and not selected_nodes:
- # We failed to find any asap nodes to merge, so ignore
- # them for the next iteration.
- prefer_asap = False
- continue
+ if prefer_asap and asap_nodes:
+ if not selected_nodes:
+ # We failed to find any asap nodes to merge,
+ # 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 selected_nodes is a leaf node
+ # when medium_soft deps are ignored.
+ for node in selected_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