serialize_tasks: debug output for runtime cycles
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Jun 2011 16:26:47 +0000 (09:26 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Jun 2011 16:26:47 +0000 (09:26 -0700)
pym/_emerge/depgraph.py

index 37dde2d81f9ca9ba0f461c7282032f24ab4bbda3..41924b460ca47d86c70a4113068e8cf515aca6ef 100644 (file)
@@ -4698,7 +4698,9 @@ class depgraph(object):
 
        def _serialize_tasks(self):
 
-               if "--debug" in self._frozen_config.myopts:
+               debug = "--debug" in self._frozen_config.myopts
+
+               if debug:
                        writemsg("\ndigraph:\n\n", noiselevel=-1)
                        self._dynamic_config.digraph.debug_print()
                        writemsg("\n", noiselevel=-1)
@@ -5050,6 +5052,15 @@ class depgraph(object):
 
                                        selected_nodes = smallest_cycle
 
+                                       if selected_nodes and debug:
+                                               writemsg("\nruntime cycle digraph (%s nodes):\n\n" %
+                                                       (len(selected_nodes),), noiselevel=-1)
+                                               cycle_digraph = mygraph.copy()
+                                               cycle_digraph.difference_update([x for x in
+                                                       cycle_digraph if x not in selected_nodes])
+                                               cycle_digraph.debug_print()
+                                               writemsg("\n", noiselevel=-1)
+
                                        if prefer_asap and asap_nodes and not selected_nodes:
                                                # We failed to find any asap nodes to merge, so ignore
                                                # them for the next iteration.