summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-10 04:03:19 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-10 04:03:19 +0000
commit38f1eec9cf52b805077366b1582799e2d560557a (patch)
tree14a16b4914e4decb98a8b69aec2d14ca00dc8d5a
parent092f65a696514c051d0ae26e8b21a13434fa7346 (diff)
downloadportage-38f1eec9cf52b805077366b1582799e2d560557a.tar.gz
portage-38f1eec9cf52b805077366b1582799e2d560557a.tar.bz2
portage-38f1eec9cf52b805077366b1582799e2d560557a.zip
Revert r12405 since it will be more convenient to use a separate graph to
store blocked package edges. svn path=/main/trunk/; revision=12407
-rw-r--r--pym/_emerge/__init__.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 180ad44dc..fb4937bfb 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -4482,7 +4482,7 @@ class depgraph(object):
self._blocker_parents = digraph()
# Contains only irrelevant Package -> Blocker edges
self._irrelevant_blockers = digraph()
- # Contains only unsolvable Package -> Blocker -> Blocked Package edges
+ # Contains only unsolvable Package -> Blocker edges
self._unsolvable_blockers = digraph()
self._slot_collision_info = {}
# Slot collision nodes are not allowed to block other packages since
@@ -6429,7 +6429,7 @@ class depgraph(object):
self._blocker_parents.remove(pkg)
continue
for parent in self._blocker_parents.parent_nodes(blocker):
- unresolved_blocks = set()
+ unresolved_blocks = False
depends_on_order = set()
for pkg in blocked_initial:
if pkg.slot_atom == parent.slot_atom:
@@ -6451,7 +6451,7 @@ class depgraph(object):
continue
# None of the above blocker resolutions techniques apply,
# so apparently this one is unresolvable.
- unresolved_blocks.add(pkg)
+ unresolved_blocks = True
for pkg in blocked_final:
if pkg.slot_atom == parent.slot_atom:
# TODO: Support blocks within slots.
@@ -6472,7 +6472,16 @@ class depgraph(object):
continue
# None of the above blocker resolutions techniques apply,
# so apparently this one is unresolvable.
- unresolved_blocks.add(pkg)
+ unresolved_blocks = True
+
+ # Make sure we don't unmerge any package that have been pulled
+ # into the graph.
+ if not unresolved_blocks and depends_on_order:
+ for inst_pkg, inst_task in depends_on_order:
+ if self.digraph.contains(inst_pkg) and \
+ self.digraph.parent_nodes(inst_pkg):
+ unresolved_blocks = True
+ break
if not unresolved_blocks and depends_on_order:
for inst_pkg, inst_task in depends_on_order:
@@ -6499,8 +6508,6 @@ class depgraph(object):
self._blocker_parents.remove(parent)
if unresolved_blocks:
self._unsolvable_blockers.add(blocker, parent)
- for pkg in unresolved_blocks:
- self._unsolvable_blockers.add(pkg, blocker)
return True
@@ -7105,8 +7112,7 @@ class depgraph(object):
root=blocker.root, eapi=blocker.eapi,
satisfied=True))
- unsolvable_blockers = set(node for node in \
- self._unsolvable_blockers if isinstance(node, Blocker))
+ unsolvable_blockers = set(self._unsolvable_blockers.leaf_nodes())
for node in myblocker_uninstalls.root_nodes():
unsolvable_blockers.add(node)