summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamuel.bissig <samuel.bissig@toradex.com>2021-04-22 14:25:07 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2021-05-24 18:33:19 +0200
commit83d9dea6139ea2604a0c00ab15e68c30e3c4e513 (patch)
tree427de6f72e29921a4432d61cc6a1cd80653ef954
parent2a57f0816dfd3b30ed178f1cb4979fad63dbfc2c (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)
-rwxr-xr-xscripts/uprev-srcrev8
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.')