diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-02-19 16:40:03 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-23 08:08:20 +0000 |
commit | 73a5bdc7921791b954ca717293e76c7e3091a19e (patch) | |
tree | 049ca4be6a5f3feeb347908e95a3f609d7d05c46 /scripts/lib/devtool | |
parent | 7392ecd559ef71241405c704a65da171ee216ca1 (diff) | |
download | openembedded-core-73a5bdc7921791b954ca717293e76c7e3091a19e.tar.gz openembedded-core-73a5bdc7921791b954ca717293e76c7e3091a19e.tar.bz2 openembedded-core-73a5bdc7921791b954ca717293e76c7e3091a19e.zip |
devtool: support source extraction for recipes that use a shared workdir
Enable source extraction used by devtool extract / devtool modify -x for
recipes that use a shared workdir (e.g. the kernel and gcc).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/standard.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 4cb03f3a54..bf18aae686 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -137,10 +137,6 @@ def _extract_source(srctree, keep_temp, devbranch, d): logger.error("The perf recipe does not actually check out source and thus cannot be supported by this tool") return None - if 'work-shared' in d.getVar('S', True): - logger.error("The %s recipe uses a shared workdir which this tool does not currently support" % pn) - return None - if bb.data.inherits_class('image', d): logger.error("The %s recipe is an image, and therefore is not supported by this tool" % pn) return None @@ -169,6 +165,16 @@ def _extract_source(srctree, keep_temp, devbranch, d): workdir = os.path.join(tempdir, 'workdir') crd.setVar('WORKDIR', workdir) crd.setVar('T', os.path.join(tempdir, 'temp')) + if not crd.getVar('S', True).startswith(workdir): + # Usually a shared workdir recipe (kernel, gcc) + # Try to set a reasonable default + if bb.data.inherits_class('kernel', d): + crd.setVar('S', '${WORKDIR}/source') + else: + crd.setVar('S', '${WORKDIR}/${BP}') + if bb.data.inherits_class('kernel', d): + # We don't want to move the source to STAGING_KERNEL_DIR here + crd.setVar('STAGING_KERNEL_DIR', '${S}') # FIXME: This is very awkward. Unfortunately it's not currently easy to properly # execute tasks outside of bitbake itself, until then this has to suffice if we @@ -204,7 +210,10 @@ def _extract_source(srctree, keep_temp, devbranch, d): else: os.rmdir(patchdir) - if not bb.data.inherits_class('kernel-yocto', d): + if bb.data.inherits_class('kernel-yocto', d): + (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir) + initial_rev = stdout.rstrip() + else: if not os.listdir(srcsubdir): logger.error("no source unpacked to S, perhaps the %s recipe doesn't use any source?" % pn) return None |