Flush stdout before calling pkg_info() to ensure that output always shows in the...
authorZac Medico <zmedico@gentoo.org>
Sat, 22 Sep 2007 18:40:32 +0000 (18:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 22 Sep 2007 18:40:32 +0000 (18:40 -0000)
svn path=/main/trunk/; revision=7794

pym/emerge/__init__.py

index 652a3d355835ce567414effd249c2cd0a7b42b52..d11143d269f2bf69f90e847db6fab0b1737b8356 100644 (file)
@@ -5400,6 +5400,10 @@ def action_info(settings, trees, myopts, myfiles):
                        if not ebuildpath or not os.path.exists(ebuildpath):
                                out.ewarn("No ebuild found for '%s'" % pkg)
                                continue
+                       # In some cases the above print statements don't flush stdout, so
+                       # it needs to be flushed before allowing a child process to use it
+                       # so that output always shows in the correct order.
+                       sys.stdout.flush()
                        portage.doebuild(ebuildpath, "info", pkgsettings["ROOT"],
                                pkgsettings, debug=(settings.get("PORTAGE_DEBUG", "") == 1),
                                mydbapi=trees[settings["ROOT"]]["vartree"].dbapi,