summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-04 13:20:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:27:44 +0000
commit221705f0143c9ba4c11180dc9ff1bf29966b23bc (patch)
treeb6c9d903b8a23a910bbc773f636dadca29063175 /scripts
parent9adae67e71f16b36a33479aa661ee0fd0180945c (diff)
downloadpoky-221705f0143c9ba4c11180dc9ff1bf29966b23bc.tar.gz
devtool: modify: get correct initial revision from previously extracted source tree
If you point devtool modify to a source tree previously created by devtool modify or devtool extract, then we need to try to pick up the correct initial revision so that devtool update-recipe knows where to start looking for commits that match up with patches in the recipe. (From OE-Core rev: c20e10543e268ebb43074a3f8d6e7ed991e54ec8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 32fb3b656b..f9369eeef0 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -326,8 +326,19 @@ def modify(args, config, basepath, workspace):
326 commits = stdout.split() 326 commits = stdout.split()
327 else: 327 else:
328 if os.path.exists(os.path.join(args.srctree, '.git')): 328 if os.path.exists(os.path.join(args.srctree, '.git')):
329 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree) 329 # Check if it's a tree previously extracted by us
330 initial_rev = stdout.rstrip() 330 try:
331 (stdout, _) = bb.process.run('git branch --contains devtool-base', cwd=args.srctree)
332 except bb.process.ExecutionError:
333 stdout = ''
334 for line in stdout.splitlines():
335 if line.startswith('*'):
336 (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=args.srctree)
337 initial_rev = stdout.rstrip()
338 if not initial_rev:
339 # Otherwise, just grab the head revision
340 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree)
341 initial_rev = stdout.rstrip()
331 342
332 # Check that recipe isn't using a shared workdir 343 # Check that recipe isn't using a shared workdir
333 s = rd.getVar('S', True) 344 s = rd.getVar('S', True)