Bug #335642 - Revert depgraph._show_unsatisfied_dep() to display to
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Sep 2010 05:22:52 +0000 (22:22 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Sep 2010 05:22:52 +0000 (22:22 -0700)
stdout, so that app-portage/autounmask continues to work. Note that
depgraph.display_problems() temporarily overrides the stdout stream
to point to stderr, so mask messages shown there continue to go
to stderr. Maybe the emerge --autounmask will eventually make
app-portage/autounmask obsolete, but for now we should support both
approaches since emerge --autounmask is relatively experimental.

pym/_emerge/depgraph.py

index aa1427b440b316fa8af5d5c2d53dd59a2c7ad188..f213c07e4a81bfe2ceb44a77b089eb8466ed36af 100644 (file)
@@ -2226,29 +2226,29 @@ class depgraph(object):
                mask_docs = False
 
                if show_missing_use:
-                       writemsg("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".\n", noiselevel=-1)
-                       writemsg("!!! One of the following packages is required to complete your request:\n", noiselevel=-1)
+                       writemsg_stdout("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+                       writemsg_stdout("!!! One of the following packages is required to complete your request:\n", noiselevel=-1)
                        for pkg, mreasons in show_missing_use:
-                               writemsg("- "+pkg.cpv+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
+                               writemsg_stdout("- "+pkg.cpv+" ("+", ".join(mreasons)+")\n", noiselevel=-1)
 
                elif masked_packages:
-                       writemsg("\n!!! " + \
+                       writemsg_stdout("\n!!! " + \
                                colorize("BAD", "All ebuilds that could satisfy ") + \
                                colorize("INFORM", xinfo) + \
                                colorize("BAD", " have been masked.") + "\n", noiselevel=-1)
-                       writemsg("!!! One of the following masked packages is required to complete your request:\n", noiselevel=-1)
+                       writemsg_stdout("!!! One of the following masked packages is required to complete your request:\n", noiselevel=-1)
                        have_eapi_mask = show_masked_packages(masked_packages)
                        if have_eapi_mask:
-                               writemsg("\n", noiselevel=-1)
+                               writemsg_stdout("\n", noiselevel=-1)
                                msg = ("The current version of portage supports " + \
                                        "EAPI '%s'. You must upgrade to a newer version" + \
                                        " of portage before EAPI masked packages can" + \
                                        " be installed.") % portage.const.EAPI
-                               writemsg("\n".join(textwrap.wrap(msg, 75)), noiselevel=-1)
-                       writemsg("\n", noiselevel=-1)
+                               writemsg_stdout("\n".join(textwrap.wrap(msg, 75)), noiselevel=-1)
+                       writemsg_stdout("\n", noiselevel=-1)
                        mask_docs = True
                else:
-                       writemsg("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
+                       writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
 
                # Show parent nodes and the argument that pulled them in.
                traversed_nodes = set()
@@ -2276,12 +2276,12 @@ class depgraph(object):
                                if parent not in traversed_nodes:
                                        selected_parent = parent
                        node = selected_parent
-               writemsg("\n".join(msg), noiselevel=-1)
-               writemsg("\n", noiselevel=-1)
+               writemsg_stdout("\n".join(msg), noiselevel=-1)
+               writemsg_stdout("\n", noiselevel=-1)
 
                if mask_docs:
                        show_mask_docs()
-                       writemsg("\n", noiselevel=-1)
+                       writemsg_stdout("\n", noiselevel=-1)
 
        def _iter_match_pkgs_any(self, root_config, atom, onlydeps=False):
                for db, pkg_type, built, installed, db_keys in \
@@ -6105,8 +6105,8 @@ def show_masked_packages(masked_packages):
        return have_eapi_mask
 
 def show_mask_docs():
-       writemsg("For more information, see the MASKED PACKAGES section in the emerge\n", noiselevel=-1)
-       writemsg("man page or refer to the Gentoo Handbook.\n", noiselevel=-1)
+       writemsg_stdout("For more information, see the MASKED PACKAGES section in the emerge\n", noiselevel=-1)
+       writemsg_stdout("man page or refer to the Gentoo Handbook.\n", noiselevel=-1)
 
 def filter_iuse_defaults(iuse):
        for flag in iuse: