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-09-23 15:27:04 +0100
commitd3ee5489c9e4518499d759ed56388b85a69d8b9c (patch)
tree6510a9f68aaa4804e895d60a8edf07bc5d5e4c1a /meta/classes
parent9a1694e242450da6579e5701fa50dd260134cc04 (diff)
downloadpoky-d3ee5489c9e4518499d759ed56388b85a69d8b9c.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) (From OE-Core rev: 696dd4607766a07fcdbb7e6bfc07f3b815bc9d5c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.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 c3c2669939..3c3cf1321c 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}