summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-04-27 10:53:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-27 15:05:52 +0100
commit216d26aac2c78ddde4532713b5f0bfa560a346b9 (patch)
treef3f725d337679e5b354c2636b15d48d8f2b091d2 /scripts/lib
parentd6cd355def1b9cccf82bdf81deb6508b32dd29af (diff)
downloadpoky-216d26aac2c78ddde4532713b5f0bfa560a346b9.tar.gz
devtool: update-recipe: check if source tree is a git repository
If you've done "devtool add" (or "devtool modify" without -x) then it's possible that the external source tree is not a git repository, so we should handle that case here instead of printing a traceback. (From OE-Core rev: eb2147aa8facd4ef33a0749e9ae660ec686dad48) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-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 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