summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-03-22 18:47:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-04 15:05:49 +0100
commiteccae514b71394ffaed8fc45dea7942152a334a1 (patch)
treef75f186d2733e3205c4e9e83ac2ebacc8ed46522
parenta93c45fa77eb7ea31b91d5bad3c64634bd1476ee (diff)
downloadopenembedded-core-contrib-eccae514b71394ffaed8fc45dea7942152a334a1.tar.gz
openembedded-core-contrib-eccae514b71394ffaed8fc45dea7942152a334a1.tar.bz2
openembedded-core-contrib-eccae514b71394ffaed8fc45dea7942152a334a1.zip
base.bbclass wipe ${S} before unpacking source
Make sure that we have a pristine source tree after do_unpack. [YOCTO #9064] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--meta/classes/base.bbclass18
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 5d8e8d6701..f2e3d4092e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -136,23 +136,21 @@ python base_do_fetch() {
addtask unpack after do_fetch
do_unpack[dirs] = "${WORKDIR}"
+
+python () {
+ if d.getVar('S', True) != d.getVar('WORKDIR', True):
+ d.setVarFlag('do_unpack', 'cleandirs', '${S}')
+ else:
+ d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', 'patches'))
+}
python base_do_unpack() {
src_uri = (d.getVar('SRC_URI', True) or "").split()
if len(src_uri) == 0:
return
- rootdir = d.getVar('WORKDIR', True)
-
- # Ensure that we cleanup ${S}/patches
- # TODO: Investigate if we can remove
- # the entire ${S} in this case.
- s_dir = d.getVar('S', True)
- p_dir = os.path.join(s_dir, 'patches')
- bb.utils.remove(p_dir, True)
-
try:
fetcher = bb.fetch2.Fetch(src_uri, d)
- fetcher.unpack(rootdir)
+ fetcher.unpack(d.getVar('WORKDIR', True))
except bb.fetch2.BBFetchException as e:
raise bb.build.FuncFailed(e)
}