1 |
Author: zmedico |
2 |
Date: 2009-02-02 19:19:19 +0000 (Mon, 02 Feb 2009) |
3 |
New Revision: 12570 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
In depgraph._serialize_tasks(), when separating uninstall nodes from leaf |
9 |
nodes, do it earlier so that it covers more code paths. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/_emerge/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/_emerge/__init__.py 2009-02-02 06:11:06 UTC (rev 12569) |
15 |
+++ main/trunk/pym/_emerge/__init__.py 2009-02-02 19:19:19 UTC (rev 12570) |
16 |
@@ -6898,21 +6898,26 @@ |
17 |
for ignore_priority in ignore_priority_soft_range: |
18 |
nodes = get_nodes(ignore_priority=ignore_priority) |
19 |
if nodes: |
20 |
+ # If there is a mix of uninstall nodes with other |
21 |
+ # types, save the uninstall nodes for later since |
22 |
+ # sometimes a merge node will render an uninstall |
23 |
+ # node unnecessary (due to occupying the same slot), |
24 |
+ # and we want to avoid executing a separate uninstall |
25 |
+ # task in that case. |
26 |
+ if len(nodes) > 1: |
27 |
+ non_uninstalls = [node for node in nodes \ |
28 |
+ if node.operation != "uninstall"] |
29 |
+ if non_uninstalls: |
30 |
+ nodes = non_uninstalls |
31 |
+ else: |
32 |
+ nodes = nodes |
33 |
+ |
34 |
if ignore_priority is None and not tree_mode: |
35 |
# Greedily pop all of these nodes since no |
36 |
# relationship has been ignored. This optimization |
37 |
# destroys --tree output, so it's disabled in tree |
38 |
- # mode. If there is a mix of merge and uninstall |
39 |
- # nodes, save the uninstall nodes for later since |
40 |
- # sometimes a merge node will render an install |
41 |
- # node unnecessary, and we want to avoid doing a |
42 |
- # separate uninstall task in that case. |
43 |
- merge_nodes = [node for node in nodes \ |
44 |
- if node.operation == "merge"] |
45 |
- if merge_nodes: |
46 |
- selected_nodes = merge_nodes |
47 |
- else: |
48 |
- selected_nodes = nodes |
49 |
+ # mode. |
50 |
+ selected_nodes = nodes |
51 |
else: |
52 |
# For optimal merge order: |
53 |
# * Only pop one node. |