1 |
Author: zmedico |
2 |
Date: 2009-01-10 04:03:19 +0000 (Sat, 10 Jan 2009) |
3 |
New Revision: 12407 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Revert r12405 since it will be more convenient to use a separate graph to |
9 |
store blocked package edges. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/_emerge/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/_emerge/__init__.py 2009-01-10 01:01:04 UTC (rev 12406) |
15 |
+++ main/trunk/pym/_emerge/__init__.py 2009-01-10 04:03:19 UTC (rev 12407) |
16 |
@@ -4482,7 +4482,7 @@ |
17 |
self._blocker_parents = digraph() |
18 |
# Contains only irrelevant Package -> Blocker edges |
19 |
self._irrelevant_blockers = digraph() |
20 |
- # Contains only unsolvable Package -> Blocker -> Blocked Package edges |
21 |
+ # Contains only unsolvable Package -> Blocker edges |
22 |
self._unsolvable_blockers = digraph() |
23 |
self._slot_collision_info = {} |
24 |
# Slot collision nodes are not allowed to block other packages since |
25 |
@@ -6429,7 +6429,7 @@ |
26 |
self._blocker_parents.remove(pkg) |
27 |
continue |
28 |
for parent in self._blocker_parents.parent_nodes(blocker): |
29 |
- unresolved_blocks = set() |
30 |
+ unresolved_blocks = False |
31 |
depends_on_order = set() |
32 |
for pkg in blocked_initial: |
33 |
if pkg.slot_atom == parent.slot_atom: |
34 |
@@ -6451,7 +6451,7 @@ |
35 |
continue |
36 |
# None of the above blocker resolutions techniques apply, |
37 |
# so apparently this one is unresolvable. |
38 |
- unresolved_blocks.add(pkg) |
39 |
+ unresolved_blocks = True |
40 |
for pkg in blocked_final: |
41 |
if pkg.slot_atom == parent.slot_atom: |
42 |
# TODO: Support blocks within slots. |
43 |
@@ -6472,10 +6472,19 @@ |
44 |
continue |
45 |
# None of the above blocker resolutions techniques apply, |
46 |
# so apparently this one is unresolvable. |
47 |
- unresolved_blocks.add(pkg) |
48 |
+ unresolved_blocks = True |
49 |
|
50 |
+ # Make sure we don't unmerge any package that have been pulled |
51 |
+ # into the graph. |
52 |
if not unresolved_blocks and depends_on_order: |
53 |
for inst_pkg, inst_task in depends_on_order: |
54 |
+ if self.digraph.contains(inst_pkg) and \ |
55 |
+ self.digraph.parent_nodes(inst_pkg): |
56 |
+ unresolved_blocks = True |
57 |
+ break |
58 |
+ |
59 |
+ if not unresolved_blocks and depends_on_order: |
60 |
+ for inst_pkg, inst_task in depends_on_order: |
61 |
uninst_task = Package(built=inst_pkg.built, |
62 |
cpv=inst_pkg.cpv, installed=inst_pkg.installed, |
63 |
metadata=inst_pkg.metadata, |
64 |
@@ -6499,8 +6508,6 @@ |
65 |
self._blocker_parents.remove(parent) |
66 |
if unresolved_blocks: |
67 |
self._unsolvable_blockers.add(blocker, parent) |
68 |
- for pkg in unresolved_blocks: |
69 |
- self._unsolvable_blockers.add(pkg, blocker) |
70 |
|
71 |
return True |
72 |
|
73 |
@@ -7105,8 +7112,7 @@ |
74 |
root=blocker.root, eapi=blocker.eapi, |
75 |
satisfied=True)) |
76 |
|
77 |
- unsolvable_blockers = set(node for node in \ |
78 |
- self._unsolvable_blockers if isinstance(node, Blocker)) |
79 |
+ unsolvable_blockers = set(self._unsolvable_blockers.leaf_nodes()) |
80 |
for node in myblocker_uninstalls.root_nodes(): |
81 |
unsolvable_blockers.add(node) |