diff options
-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() |