1 |
Author: zmedico |
2 |
Date: 2009-02-02 01:03:47 +0000 (Mon, 02 Feb 2009) |
3 |
New Revision: 12568 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Fix logic inside depgraph._serialize_tasks() to avoid the circular runtime |
9 |
deps path in some cases when it's not appropriate. This solves a case that |
10 |
was reported, in which the perl was merged before libperl due do perl and |
11 |
lots of it's deps being selected all at once. In this case, so many packages |
12 |
were selected at once that the cmp_circular_bias() sort did not order them |
13 |
very well (though it normally works fine with a smaller number of packages). |
14 |
Thanks to Daniel Robbins for reporting this issue and helping me reproduce |
15 |
it. |
16 |
|
17 |
|
18 |
Modified: main/trunk/pym/_emerge/__init__.py |
19 |
=================================================================== |
20 |
--- main/trunk/pym/_emerge/__init__.py 2009-01-31 20:43:26 UTC (rev 12567) |
21 |
+++ main/trunk/pym/_emerge/__init__.py 2009-02-02 01:03:47 UTC (rev 12568) |
22 |
@@ -6898,37 +6898,37 @@ |
23 |
for ignore_priority in ignore_priority_soft_range: |
24 |
nodes = get_nodes(ignore_priority=ignore_priority) |
25 |
if nodes: |
26 |
- break |
27 |
- if nodes: |
28 |
- if ignore_priority is None and not tree_mode: |
29 |
- # Greedily pop all of these nodes since no relationship |
30 |
- # has been ignored. This optimization destroys --tree |
31 |
- # output, so it's disabled in reversed mode. If there |
32 |
- # is a mix of merge and uninstall nodes, save the |
33 |
- # uninstall nodes from later since sometimes a merge |
34 |
- # node will render an install node unnecessary, and |
35 |
- # we want to avoid doing a separate uninstall task in |
36 |
- # that case. |
37 |
- merge_nodes = [node for node in nodes \ |
38 |
- if node.operation == "merge"] |
39 |
- if merge_nodes: |
40 |
- selected_nodes = merge_nodes |
41 |
+ if ignore_priority is None and not tree_mode: |
42 |
+ # Greedily pop all of these nodes since no |
43 |
+ # relationship has been ignored. This optimization |
44 |
+ # destroys --tree output, so it's disabled in tree |
45 |
+ # mode. If there is a mix of merge and uninstall |
46 |
+ # nodes, save the uninstall nodes for later since |
47 |
+ # sometimes a merge node will render an install |
48 |
+ # node unnecessary, and we want to avoid doing a |
49 |
+ # separate uninstall task in that case. |
50 |
+ merge_nodes = [node for node in nodes \ |
51 |
+ if node.operation == "merge"] |
52 |
+ if merge_nodes: |
53 |
+ selected_nodes = merge_nodes |
54 |
+ else: |
55 |
+ selected_nodes = nodes |
56 |
else: |
57 |
- selected_nodes = nodes |
58 |
- else: |
59 |
- # For optimal merge order: |
60 |
- # * Only pop one node. |
61 |
- # * Removing a root node (node without a parent) |
62 |
- # will not produce a leaf node, so avoid it. |
63 |
- for node in nodes: |
64 |
- if mygraph.parent_nodes(node): |
65 |
- # found a non-root node |
66 |
- selected_nodes = [node] |
67 |
- break |
68 |
- if not selected_nodes and \ |
69 |
- (accept_root_node or ignore_priority is None): |
70 |
- # settle for a root node |
71 |
- selected_nodes = [nodes[0]] |
72 |
+ # For optimal merge order: |
73 |
+ # * Only pop one node. |
74 |
+ # * Removing a root node (node without a parent) |
75 |
+ # will not produce a leaf node, so avoid it. |
76 |
+ for node in nodes: |
77 |
+ if mygraph.parent_nodes(node): |
78 |
+ # found a non-root node |
79 |
+ selected_nodes = [node] |
80 |
+ break |
81 |
+ if not selected_nodes and \ |
82 |
+ (accept_root_node or ignore_priority is None): |
83 |
+ # settle for a root node |
84 |
+ selected_nodes = [nodes[0]] |
85 |
+ if selected_nodes: |
86 |
+ break |
87 |
|
88 |
if not selected_nodes: |
89 |
nodes = get_nodes(ignore_priority=DepPriority.MEDIUM) |