diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-09 17:29:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-09 17:29:07 +0000 |
commit | c6a4ff425c95023bed711b22e07d9e9caf6b231c (patch) | |
tree | 18d74abff1c6dd0decf151b770916d019b1c8806 | |
parent | 82b0a1c0504e7c4916d3e5e08113bb64a67c2357 (diff) | |
download | portage-c6a4ff425c95023bed711b22e07d9e9caf6b231c.tar.gz portage-c6a4ff425c95023bed711b22e07d9e9caf6b231c.tar.bz2 portage-c6a4ff425c95023bed711b22e07d9e9caf6b231c.zip |
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.
svn path=/main/trunk/; revision=12185
-rw-r--r-- | pym/_emerge/__init__.py | 6 | ||||
-rw-r--r-- | pym/portage/__init__.py | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index c9b7113af..fc320ad75 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -6415,6 +6415,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 2a559f3af..59ddfd5d8 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 |