summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamuel.bissig <samuel.bissig@toradex.com>2021-04-22 14:25:07 +0200
committersamuel.bissig <samuel.bissig@toradex.com>2021-04-22 14:25:07 +0200
commita5fcc0566de94d92f78ab156f641ac5dc58855fc (patch)
treeaa120951987118dfddb69d3660899e7ef6a03cc2
parent213eb8b0826eb8f33c3a87518762dca480c85354 (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>
-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.')