[kirkstone,22/34] terminal.py: Restore error output from Terminal

Message ID f8f8e2e159a5ac03f619e6d0882011445e6a2545.1651246310.git.steve@sakoman.com
State Accepted, archived
Commit f8f8e2e159a5ac03f619e6d0882011445e6a2545
Headers show
Series [kirkstone,01/34] e2fsprogs: fix CVE-2022-1304 | expand

Commit Message

Steve Sakoman April 29, 2022, 4 p.m. UTC
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

In bitbake commit 1ecc1d94 (process: Do not mix stderr with stdout),
bb.process.Popen() was changed to no longer combine stdout and stderr by
default. However, the Terminal class was not updated to reflect this and
subsequently only output stdout in case of failures.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 116d0bb07ba044cf8847bf3d5c3996ad7e58b7ae)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oe/terminal.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 53186c4a3e..de8dcebf94 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -30,9 +30,10 @@  class Registry(oe.classutils.ClassRegistry):
 
 class Terminal(Popen, metaclass=Registry):
     def __init__(self, sh_cmd, title=None, env=None, d=None):
+        from subprocess import STDOUT
         fmt_sh_cmd = self.format_command(sh_cmd, title)
         try:
-            Popen.__init__(self, fmt_sh_cmd, env=env)
+            Popen.__init__(self, fmt_sh_cmd, env=env, stderr=STDOUT)
         except OSError as exc:
             import errno
             if exc.errno == errno.ENOENT: