Patchwork [bitbake-devel] knotty: Ensure the progress bar shows on stdout

login
register
mail settings
Submitter Richard Purdie
Date March 26, 2014, 4:56 p.m.
Message ID <1395852968.24890.106.camel@ted>
Download mbox | patch
Permalink /patch/69329/
State New
Headers show

Comments

Richard Purdie - March 26, 2014, 4:56 p.m.
I can understand why some programs would want the progress on stderr so
that real output can be captured on stdout. This is confusing for bitbake
since we don't show a progress bar at all in non-interactive cases.

Therefore make sure the progress bar goes to stdout, not the stderr default.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 009653c..31c2dbb 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -49,7 +49,7 @@  class BBProgress(progressbar.ProgressBar):
             self._resize_default = signal.getsignal(signal.SIGWINCH)
         except:
             self._resize_default = None
-        progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets)
+        progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets, fd=sys.stdout)
 
     def _handle_resize(self, signum, frame):
         progressbar.ProgressBar._handle_resize(self, signum, frame)