diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-08-26 15:29:41 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-04 16:23:51 +0100 |
commit | 3b3f9bbc30f6e4fa07b821b9c03112df17844972 (patch) | |
tree | 638e9a69d6cbb839fb5e0c52398f65be725a23a8 /scripts/lib/devtool/standard.py | |
parent | 9e9fd091d591dfb1f07506eace6df3240d768b65 (diff) | |
download | poky-3b3f9bbc30f6e4fa07b821b9c03112df17844972.tar.gz |
devtool: extract: correct initial rev for kernel packages
Change handling of kernel packages so that the "initial rev" is parsed
correctly. Also, the devtool-specific git tags (devtool-base and
devtoo-patched) are now generated for kernel packages as well.
[YOCTO #6658]
(From OE-Core rev: 65fe3e45b10c5578446c758f66840891c62cd774)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 6ba86ed801..f2621cdb91 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -273,6 +273,10 @@ def _extract_source(srctree, keep_temp, devbranch, d): | |||
273 | task_executor.exec_func('do_fetch', False) | 273 | task_executor.exec_func('do_fetch', False) |
274 | logger.info('Unpacking...') | 274 | logger.info('Unpacking...') |
275 | task_executor.exec_func('do_unpack', False) | 275 | task_executor.exec_func('do_unpack', False) |
276 | if bb.data.inherits_class('kernel-yocto', d): | ||
277 | # Extra step for kernel to populate the source directory | ||
278 | logger.info('Doing kernel checkout...') | ||
279 | task_executor.exec_func('do_kernel_checkout', False) | ||
276 | srcsubdir = crd.getVar('S', True) | 280 | srcsubdir = crd.getVar('S', True) |
277 | if srcsubdir == workdir: | 281 | if srcsubdir == workdir: |
278 | # Find non-patch sources that were "unpacked" to srctree directory | 282 | # Find non-patch sources that were "unpacked" to srctree directory |
@@ -302,26 +306,21 @@ def _extract_source(srctree, keep_temp, devbranch, d): | |||
302 | else: | 306 | else: |
303 | os.rmdir(patchdir) | 307 | os.rmdir(patchdir) |
304 | 308 | ||
305 | if bb.data.inherits_class('kernel-yocto', d): | 309 | if not os.listdir(srcsubdir): |
306 | (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir) | 310 | raise DevtoolError("no source unpacked to S, perhaps the %s " |
307 | initial_rev = stdout.rstrip() | 311 | "recipe doesn't use any source?" % pn) |
308 | else: | ||
309 | if not os.listdir(srcsubdir): | ||
310 | raise DevtoolError("no source unpacked to S, perhaps the %s " | ||
311 | "recipe doesn't use any source?" % pn) | ||
312 | 312 | ||
313 | if not os.path.exists(os.path.join(srcsubdir, '.git')): | 313 | if not os.path.exists(os.path.join(srcsubdir, '.git')): |
314 | bb.process.run('git init', cwd=srcsubdir) | 314 | bb.process.run('git init', cwd=srcsubdir) |
315 | bb.process.run('git add .', cwd=srcsubdir) | 315 | bb.process.run('git add .', cwd=srcsubdir) |
316 | bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir) | 316 | bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir) |
317 | 317 | ||
318 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) | 318 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) |
319 | initial_rev = stdout.rstrip() | 319 | initial_rev = stdout.rstrip() |
320 | |||
321 | bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir) | ||
322 | bb.process.run('git tag -f devtool-base', cwd=srcsubdir) | ||
323 | 320 | ||
324 | crd.setVar('PATCHTOOL', 'git') | 321 | bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir) |
322 | bb.process.run('git tag -f devtool-base', cwd=srcsubdir) | ||
323 | crd.setVar('PATCHTOOL', 'git') | ||
325 | 324 | ||
326 | logger.info('Patching...') | 325 | logger.info('Patching...') |
327 | task_executor.exec_func('do_patch', False) | 326 | task_executor.exec_func('do_patch', False) |