diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-02-02 01:03:47 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-02-02 01:03:47 +0000 |
commit | e9d6a559afab38ac687f17bb261a4ddde62a3247 (patch) | |
tree | 04a9c3a9d55667e6c6fe0f46100f1fdc18301b30 | |
parent | 351668a24882416c86293e700a826bad6c3070a4 (diff) | |
download | portage-e9d6a559afab38ac687f17bb261a4ddde62a3247.tar.gz portage-e9d6a559afab38ac687f17bb261a4ddde62a3247.tar.bz2 portage-e9d6a559afab38ac687f17bb261a4ddde62a3247.zip |
Fix logic inside depgraph._serialize_tasks() to avoid the circular runtime
deps path in some cases when it's not appropriate. This solves a case that
was reported, in which the perl was merged before libperl due do perl and
lots of it's deps being selected all at once. In this case, so many packages
were selected at once that the cmp_circular_bias() sort did not order them
very well (though it normally works fine with a smaller number of packages).
Thanks to Daniel Robbins for reporting this issue and helping me reproduce
it.
svn path=/main/trunk/; revision=12568
-rw-r--r-- | pym/_emerge/__init__.py | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 615b47848..fb04b304f 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6898,37 +6898,37 @@ class depgraph(object): for ignore_priority in ignore_priority_soft_range: nodes = get_nodes(ignore_priority=ignore_priority) if nodes: - break - if nodes: - if ignore_priority is None and not tree_mode: - # Greedily pop all of these nodes since no relationship - # has been ignored. This optimization destroys --tree - # output, so it's disabled in reversed mode. If there - # is a mix of merge and uninstall nodes, save the - # uninstall nodes from later since sometimes a merge - # node will render an install node unnecessary, and - # we want to avoid doing a separate uninstall task in - # that case. - merge_nodes = [node for node in nodes \ - if node.operation == "merge"] - if merge_nodes: - selected_nodes = merge_nodes + if ignore_priority is None and not tree_mode: + # Greedily pop all of these nodes since no + # relationship has been ignored. This optimization + # destroys --tree output, so it's disabled in tree + # mode. If there is a mix of merge and uninstall + # nodes, save the uninstall nodes for later since + # sometimes a merge node will render an install + # node unnecessary, and we want to avoid doing a + # separate uninstall task in that case. + merge_nodes = [node for node in nodes \ + if node.operation == "merge"] + if merge_nodes: + selected_nodes = merge_nodes + else: + selected_nodes = nodes else: - selected_nodes = nodes - else: - # For optimal merge order: - # * Only pop one node. - # * Removing a root node (node without a parent) - # will not produce a leaf node, so avoid it. - for node in nodes: - if mygraph.parent_nodes(node): - # found a non-root node - selected_nodes = [node] - break - if not selected_nodes and \ - (accept_root_node or ignore_priority is None): - # settle for a root node - selected_nodes = [nodes[0]] + # For optimal merge order: + # * Only pop one node. + # * Removing a root node (node without a parent) + # will not produce a leaf node, so avoid it. + for node in nodes: + if mygraph.parent_nodes(node): + # found a non-root node + selected_nodes = [node] + break + if not selected_nodes and \ + (accept_root_node or ignore_priority is None): + # settle for a root node + selected_nodes = [nodes[0]] + if selected_nodes: + break if not selected_nodes: nodes = get_nodes(ignore_priority=DepPriority.MEDIUM) |