aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-10 10:13:06 +0100
committerSteve Sakoman <steve@sakoman.com>2021-09-24 12:38:18 -1000
commitf84a2f8d8bcc2fa4cd9ab6ef80ae638d0df47965 (patch)
tree02c1832519c9cbea82f11d61629b576cebbea829
parent8dec1a58ff176b82006a084537156f65ad81def9 (diff)
downloadbitbake-contrib-f84a2f8d8bcc2fa4cd9ab6ef80ae638d0df47965.tar.gz
process: Don't include logs in error message if piping them
If the caller is piping the logs, they likely don't want them in the error exception as well. This removes duplicate output from the build output allowing the UI level controls on whether to show logs to work correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fc58ad84a9deb2620ad90611684dad65dafedb11) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--lib/bb/process.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/process.py b/lib/bb/process.py
index 2dc472a86..24c588e53 100644
--- a/lib/bb/process.py
+++ b/lib/bb/process.py
@@ -179,5 +179,8 @@ def run(cmd, input=None, log=None, extrafiles=None, **options):
stderr = stderr.decode("utf-8")
if pipe.returncode != 0:
+ if log:
+ # Don't duplicate the output in the exception if logging it
+ raise ExecutionError(cmd, pipe.returncode, None, None)
raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
return stdout, stderr