summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 0142fe0..6b53781 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -470,13 +470,19 @@ def update_recipe(args, config, basepath, workspace):
return updated
srctree = workspace[args.recipename]
- if mode == 'srcrev':
+
+ # Get HEAD revision
+ try:
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
- srcrev = stdout.strip()
- if len(srcrev) != 40:
- logger.error('Invalid hash returned by git: %s' % stdout)
- return 1
+ except bb.process.ExecutionError as err:
+ print('Failed to get HEAD revision in %s: %s' % (srctree, err))
+ return 1
+ srcrev = stdout.strip()
+ if len(srcrev) != 40:
+ logger.error('Invalid hash returned by git: %s' % stdout)
+ return 1
+ if mode == 'srcrev':
logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile))
patchfields = {}
patchfields['SRCREV'] = srcrev
OpenPOWER on IntegriCloud