Add some debug output for arguments and their associated atoms, to help in
authorZac Medico <zmedico@gentoo.org>
Tue, 27 May 2008 00:11:47 +0000 (00:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 May 2008 00:11:47 +0000 (00:11 -0000)
debugging problems similar to bug #223735. (trunk r10436)

svn path=/main/branches/2.1.2/; revision=10437

bin/emerge

index 424fbdc9151784cc06e9bd5690d6ac0666e87907..ea7394b2fc59e43b11947a8eefae91c29e365261 100755 (executable)
@@ -2604,6 +2604,7 @@ class depgraph(object):
        def select_files(self, myfiles):
                """Given a list of .tbz2s, .ebuilds sets, and deps, create the
                appropriate depgraph and return a favorite list."""
+               debug = "--debug" in self.myopts
                root_config = self.roots[self.target_root]
                sets = root_config.sets
                getSetAtoms = root_config.setconfig.getSetAtoms
@@ -2840,6 +2841,8 @@ class depgraph(object):
                                        if arg not in refs:
                                                refs.append(arg)
                pprovideddict = pkgsettings.pprovideddict
+               if debug:
+                       portage.writemsg("\n", noiselevel=-1)
                # Order needs to be preserved since a feature of --nodeps
                # is to allow the user to force a specific merge order.
                args.reverse()
@@ -2861,6 +2864,9 @@ class depgraph(object):
                                                                "dependencies for %s\n") % arg.arg)
                                                        return 0, myfavorites
                                                continue
+                                       if debug:
+                                               portage.writemsg("      Arg: %s\n     Atom: %s\n" % \
+                                                       (arg, atom), noiselevel=-1)
                                        pkg, existing_node = self._select_package(
                                                myroot, atom, onlydeps=onlydeps)
                                        if not pkg:
@@ -3300,7 +3306,8 @@ class depgraph(object):
 
                if "--debug" in self.myopts:
                        for pkg in matched_packages:
-                               print (pkg.type_name + ":").rjust(10), pkg.cpv
+                               portage.writemsg("%s %s\n" % \
+                                       ((pkg.type_name + ":").rjust(10), pkg.cpv), noiselevel=-1)
 
                # Filter out any old-style virtual matches if they are
                # mixed with new-style virtual matches.