build: Propagate non-zero exit status when running in a tty

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Paul Barker 2020-05-19 10:45:16 +02:00 committed by Jan Kiszka
parent 6ada99e40d
commit 3ba7091251

View File

@ -133,6 +133,9 @@ class BuildCommand(Command):
+ ctx.config.get_bitbake_targets())
if sys.stdout.isatty():
logging.info('%s$ %s', ctx.build_dir, ' '.join(cmd))
subprocess.call(cmd, env=ctx.environ, cwd=ctx.build_dir)
ret = subprocess.call(cmd, env=ctx.environ, cwd=ctx.build_dir)
if ret != 0:
logging.error('Command returned non-zero exit status %d', ret)
sys.exit(ret)
else:
run_cmd(cmd, cwd=ctx.build_dir)