diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-28 14:21:06 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-28 14:21:06 -0700 |
commit | 3b05d2eb59106413a923bbee0bfff5429548f722 (patch) | |
tree | 1477e435fd40bbf0cf85ec04cb1ce20faff0fcb0 | |
parent | 988416d6a172458d49a787f053b8e44a22830857 (diff) | |
download | portage-3b05d2eb59106413a923bbee0bfff5429548f722.tar.gz portage-3b05d2eb59106413a923bbee0bfff5429548f722.tar.bz2 portage-3b05d2eb59106413a923bbee0bfff5429548f722.zip |
If there are circular dependencies, and circular_dependency_handler
doesn't have a message, eliminate root nodes before calling
digraph.debug_print(). If --debug is enabled then do this even if
circular_dependency_handler has a message.
-rw-r--r-- | pym/_emerge/depgraph.py | 9 | ||||
-rw-r--r-- | pym/_emerge/resolver/circular_dependency.py | 15 |
2 files changed, 21 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index eb0dfb8a2..69fe00298 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4184,9 +4184,12 @@ class depgraph(object): noiselevel=-1) portage.writemsg("\n", noiselevel=-1) - if handler.circular_dep_message is None: - mygraph.debug_print() - else: + if handler.circular_dep_message is None or \ + "--debug" in self._frozen_config.myopts: + handler.debug_print() + portage.writemsg("\n", noiselevel=-1) + + if handler.circular_dep_message is not None: portage.writemsg(handler.circular_dep_message, noiselevel=-1) suggestions = handler.suggestions diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py index dbb1adf49..0ecdbbe8c 100644 --- a/pym/_emerge/resolver/circular_dependency.py +++ b/pym/_emerge/resolver/circular_dependency.py @@ -244,3 +244,18 @@ class circular_dependency_handler(object): final_solutions.setdefault(pkg, set()).add(solution) return final_solutions, suggestions + + def debug_print(self): + """ + Create a copy of the digraph, prune all root nodes, + and call the debug_print() method. + """ + graph = self.graph.copy() + while True: + root_nodes = graph.root_nodes( + ignore_priority=DepPrioritySatisfiedRange.ignore_medium_soft) + if not root_nodes: + break + graph.difference_update(root_nodes) + + graph.debug_print() |