From: Zac Medico Date: Fri, 12 Dec 2008 21:25:36 +0000 (-0000) Subject: When in --debug mode, make the depgraph call self.digraph.debug_print() to X-Git-Tag: v2.1.6.1~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c3be86d8d02168115a5e5591b38b96a7c59cfffe;p=portage.git When in --debug mode, make the depgraph call self.digraph.debug_print() to display the final digraph state. This should help when troubleshooting problems with blockers that don't resolve automatically, by making it easier to see what pulled in unwanted packages. (trunk r12185) svn path=/main/branches/2.1.6/; revision=12220 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 9a4ad224c..559894bc6 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6399,6 +6399,12 @@ class depgraph(object): self._process_slot_conflicts() def _serialize_tasks(self): + + if "--debug" in self.myopts: + writemsg("\ndigraph:\n\n", noiselevel=-1) + self.digraph.debug_print() + writemsg("\n", noiselevel=-1) + scheduler_graph = self.digraph.copy() mygraph=self.digraph.copy() # Prune "nomerge" root nodes if nothing depends on them, since diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 3a68ec2f9..931947a66 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -536,15 +536,17 @@ class digraph(object): len(self.order) def debug_print(self): + def output(s): + writemsg(s, noiselevel=-1) for node in self.nodes: - print node, + output("%s " % (node,)) if self.nodes[node][0]: - print "depends on" + output("depends on\n") else: - print "(no children)" + output("(no children)\n") for child in self.nodes[node][0]: - print " ",child, - print "(%s)" % self.nodes[node][0][child] + output(" %s (%s)\n" % \ + (child, self.nodes[node][0][child],)) #parse /etc/env.d and generate /etc/profile.env