diff options
-rw-r--r-- | scripts/lib/devtool/standard.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index a64211211b..94b5e0bdd1 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -477,13 +477,19 @@ def update_recipe(args, config, basepath, workspace): | |||
477 | return updated | 477 | return updated |
478 | 478 | ||
479 | srctree = workspace[args.recipename] | 479 | srctree = workspace[args.recipename] |
480 | if mode == 'srcrev': | 480 | |
481 | # Get HEAD revision | ||
482 | try: | ||
481 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) | 483 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) |
482 | srcrev = stdout.strip() | 484 | except bb.process.ExecutionError as err: |
483 | if len(srcrev) != 40: | 485 | print('Failed to get HEAD revision in %s: %s' % (srctree, err)) |
484 | logger.error('Invalid hash returned by git: %s' % stdout) | 486 | return 1 |
485 | return 1 | 487 | srcrev = stdout.strip() |
488 | if len(srcrev) != 40: | ||
489 | logger.error('Invalid hash returned by git: %s' % stdout) | ||
490 | return 1 | ||
486 | 491 | ||
492 | if mode == 'srcrev': | ||
487 | logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile)) | 493 | logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile)) |
488 | patchfields = {} | 494 | patchfields = {} |
489 | patchfields['SRCREV'] = srcrev | 495 | patchfields['SRCREV'] = srcrev |