diff options
author | samuel.bissig <samuel.bissig@toradex.com> | 2021-04-22 14:25:07 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-05-24 18:33:19 +0200 |
commit | 83d9dea6139ea2604a0c00ab15e68c30e3c4e513 (patch) | |
tree | 427de6f72e29921a4432d61cc6a1cd80653ef954 /scripts | |
parent | 2a57f0816dfd3b30ed178f1cb4979fad63dbfc2c (diff) |
uprev-srcrev: return status of subprocess calls
So far exceptions have been catched in the python script and
have not been reported back to caller. The status code of the script
was always 0. This makes it impossible to the build scripts to react
on failed runs of uprev-srcrev tool.
In case a recipe can not be found, patching further recipes
gets skipped and a status code not equal to 0 is returned.
Signed-off-by: samuel.bissig <samuel.bissig@toradex.com>
(cherry picked from commit a5fcc0566de94d92f78ab156f641ac5dc58855fc)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/uprev-srcrev | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/uprev-srcrev b/scripts/uprev-srcrev index 2c1a6ef..b6bebfb 100755 --- a/scripts/uprev-srcrev +++ b/scripts/uprev-srcrev @@ -54,8 +54,9 @@ def uprev_recipe(args, env, recipe): shell=True) if not args.quiet: print(result.stdout) + return result.returncode except subprocess.CalledProcessError as e: - print('ERROR: recipetool failed:\n%s' % e.output.decode('utf-8')) + logger.error('ERROR: recipetool failed:\n%s' % e.output.decode('utf-8')) return e.returncode @@ -73,7 +74,10 @@ def uprev(args): for recipe in recipes: logger.info('Processing recipe {}'.format(recipe)) - uprev_recipe(args, env, recipe) + res = uprev_recipe(args, env, recipe) + if (res != os.EX_OK): + return res + return os.EX_OK def main(): parser = argparse_oe.ArgumentParser(description='SRCREV uprev tool.') |