summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-06-16 11:49:59 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-20 12:07:27 +0100
commit0ad5fb3431b5f5875326d929442124a8fabe0642 (patch)
tree4400a4b01dc50eb0a1459ac2dec9e6a51662e8f1 /meta
parent4dd321f8b83afecd962393101b2a6861275b5265 (diff)
downloadpoky-0ad5fb3431b5f5875326d929442124a8fabe0642.tar.gz
base.bbclass: drop compatibility moving of sources into workdir
Potentially there could be a grace period for fixing recipes (with warnings, etc), on the other hand, changes to git unpacking destination would already break various layers, so we might as well make this a hard qa error and drop the magic at the same time. I commit to sending fixes for layers included in autobuilder testing (meta-oe/arm/intel/virt/agl/aws/mingw/etc). SOURCE_BASEDIR is at the same time adjusted to be calculated relative to UNPACKDIR (previously it only worked if S was set to WORKDIR/something/otherthing, and that is no longer working). It is also no longer removed from the filesystem, as content of unpackdir is managed elsewhere. (From OE-Core rev: 53e9ea30aaf48292307b4cff6964bead74c69fff) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-global/base.bbclass13
1 files changed, 3 insertions, 10 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index e55a538e36..b86f50e283 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -183,23 +183,16 @@ python base_do_unpack() {
183 183
184 basedir = None 184 basedir = None
185 unpackdir = d.getVar('UNPACKDIR') 185 unpackdir = d.getVar('UNPACKDIR')
186 workdir = d.getVar('WORKDIR') 186 if sourcedir.startswith(unpackdir):
187 if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir): 187 basedir = sourcedir.replace(unpackdir, '').strip("/").split('/')[0]
188 basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0]
189 if basedir: 188 if basedir:
190 bb.utils.remove(workdir + '/' + basedir, True) 189 d.setVar("SOURCE_BASEDIR", unpackdir + '/' + basedir)
191 d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir)
192 190
193 try: 191 try:
194 fetcher = bb.fetch2.Fetch(src_uri, d) 192 fetcher = bb.fetch2.Fetch(src_uri, d)
195 fetcher.unpack(d.getVar('UNPACKDIR')) 193 fetcher.unpack(d.getVar('UNPACKDIR'))
196 except bb.fetch2.BBFetchException as e: 194 except bb.fetch2.BBFetchException as e:
197 bb.fatal("Bitbake Fetcher Error: " + repr(e)) 195 bb.fatal("Bitbake Fetcher Error: " + repr(e))
198
199 if basedir and os.path.exists(unpackdir + '/' + basedir):
200 # Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP}
201 # as often used in S work as expected.
202 shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir)
203} 196}
204 197
205SSTATETASKS += "do_deploy_source_date_epoch" 198SSTATETASKS += "do_deploy_source_date_epoch"