summaryrefslogtreecommitdiffstats
path: root/meta/classes
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:22:24 +0100
commita56fb90dc3805494eeaf04c60538425e8d52efc5 (patch)
treefc2504cf83d60d414e34b31c8f8fee838c8d6fd1 /meta/classes
parent3522a90f1b20aa1ea14d2ceb4a68b6df287c6e60 (diff)
downloadpoky-a56fb90dc3805494eeaf04c60538425e8d52efc5.tar.gz
base.bbclass wipe ${S} before unpacking source
Make sure that we have a pristine source tree after do_unpack. [YOCTO #9064] (From OE-Core rev: eccae514b71394ffaed8fc45dea7942152a334a1) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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() {
136 136
137addtask unpack after do_fetch 137addtask unpack after do_fetch
138do_unpack[dirs] = "${WORKDIR}" 138do_unpack[dirs] = "${WORKDIR}"
139
140python () {
141 if d.getVar('S', True) != d.getVar('WORKDIR', True):
142 d.setVarFlag('do_unpack', 'cleandirs', '${S}')
143 else:
144 d.setVarFlag('do_unpack', 'cleandirs', os.path.join('${S}', 'patches'))
145}
139python base_do_unpack() { 146python base_do_unpack() {
140 src_uri = (d.getVar('SRC_URI', True) or "").split() 147 src_uri = (d.getVar('SRC_URI', True) or "").split()
141 if len(src_uri) == 0: 148 if len(src_uri) == 0:
142 return 149 return
143 150
144 rootdir = d.getVar('WORKDIR', True)
145
146 # Ensure that we cleanup ${S}/patches
147 # TODO: Investigate if we can remove
148 # the entire ${S} in this case.
149 s_dir = d.getVar('S', True)
150 p_dir = os.path.join(s_dir, 'patches')
151 bb.utils.remove(p_dir, True)
152
153 try: 151 try:
154 fetcher = bb.fetch2.Fetch(src_uri, d) 152 fetcher = bb.fetch2.Fetch(src_uri, d)
155 fetcher.unpack(rootdir) 153 fetcher.unpack(d.getVar('WORKDIR', True))
156 except bb.fetch2.BBFetchException as e: 154 except bb.fetch2.BBFetchException as e:
157 raise bb.build.FuncFailed(e) 155 raise bb.build.FuncFailed(e)
158} 156}