summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-02-19 00:46:37 +0000
committerZac Medico <zmedico@gentoo.org>2007-02-19 00:46:37 +0000
commit40115895cfc8bfff24595770c0a3f3ff4c98fe26 (patch)
treec11fbad50c3b42806ab29bf31518f9a808a8993d /bin
parent9a7c3c9eb6a8b5305419ea62db4930d32b3f8c18 (diff)
downloadportage-40115895cfc8bfff24595770c0a3f3ff4c98fe26.tar.gz
portage-40115895cfc8bfff24595770c0a3f3ff4c98fe26.tar.bz2
portage-40115895cfc8bfff24595770c0a3f3ff4c98fe26.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. (trunk r6005:6006)
svn path=/main/branches/2.1.2/; revision=6007
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge23
1 files changed, 15 insertions, 8 deletions
diff --git a/bin/emerge b/bin/emerge
index cd19e2640..1efcc75d0 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2072,14 +2072,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)
@@ -2087,7 +2083,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: