summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-02-19 00:45:57 +0000
committerZac Medico <zmedico@gentoo.org>2007-02-19 00:45:57 +0000
commita2662ce3d7256ba3800d724eb847dc579c512b69 (patch)
tree5e698f3de59967da71298fd139244214d37720ab
parentd42e48a70986ae6a0b1c50543cdc7bc221c71016 (diff)
downloadportage-a2662ce3d7256ba3800d724eb847dc579c512b69.tar.gz
portage-a2662ce3d7256ba3800d724eb847dc579c512b69.tar.bz2
portage-a2662ce3d7256ba3800d724eb847dc579c512b69.zip
For bug #166564, make a circular dependency panic more user friendly by displaying the USE flags that are enabled on nodes that are part of dependency cycles and display a note hinting that circular dependencies can often be avoided by temporarily disabling USE flags.
svn path=/main/trunk/; revision=6006
-rw-r--r--pym/emerge/__init__.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 002e7f9dd..4db666700 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -2076,14 +2076,10 @@ class depgraph:
selected_nodes = [blocker_deps.pop()]
if not selected_nodes:
- if reversed:
- """The circular deps ouput should have less noise when
- altlist is not in reversed mode."""
- self.altlist()
- print "!!! Error: circular dependencies:"
- print
- # Reduce the noise level to a minimum via elimination of root
- # nodes.
+ # No leaf nodes are available, so we have a circular
+ # dependency panic situation. Reduce the noise level to a
+ # minimum via repeated elimination of root nodes since they
+ # have no parents and thus can not be part of a cycle.
while True:
root_nodes = mygraph.root_nodes(
ignore_priority=DepPriority.SOFT)
@@ -2091,7 +2087,18 @@ class depgraph:
break
for node in root_nodes:
mygraph.remove(node)
+ # Display the USE flags that are enabled on nodes that are part
+ # of dependency cycles in case that helps the user decide to
+ # disable some of them.
+ self.myopts.pop("--quiet", None)
+ self.myopts.pop("--verbose", None)
+ self.display([list(node) for node in mygraph.order])
+ print "!!! Error: circular dependencies:"
+ print
mygraph.debug_print()
+ print
+ print "!!! Note that circular dependencies can often be avoided by temporarily"
+ print "!!! disabling USE flags that trigger optional dependencies."
sys.exit(1)
for node in selected_nodes: