aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-29 22:57:11 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-02 09:55:42 +0100
commitcf864cd84172f605b0e1777c3defc000fa3a7379 (patch)
tree3ac6b1dbb9ed48faa96ec8d610730e9f79516634 /lib
parent7d938703d9321cde5a32e4dff005f07e8821b704 (diff)
downloadbitbake-cf864cd84172f605b0e1777c3defc000fa3a7379.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: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-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 7c3995cce..d5a1775fc 100644
--- a/lib/bb/process.py
+++ b/lib/bb/process.py
@@ -181,5 +181,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