]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool-source: set S variable to a sub dir of UNPACKDIR
authorBenjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Thu, 16 Apr 2026 08:14:26 +0000 (10:14 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Apr 2026 16:58:37 +0000 (17:58 +0100)
If a recipe set UNPACKDIR to a directory that is not contained within
WORKDIR, before this modification, this generates the following error:
"S should be set relative to UNPACKDIR."

S should not be updated, otherwise the recipe may not find the extracted
sources. In all recipes, S should reference the UNPACKDIR variable.
There is an exception for the kernel to prevent infinite recursion
when expanding the STAGING_KERNEL_DIR variable.

So, only updates UNPACKDIR to be within the DEVTOOL_TEMPDIR directory.

Signed-off-by: Benjamin Robin (Schneider Electric) <benjamin.robin@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes/devtool-source.bbclass

index 2e0070486b466ead36419b382ebcfe8fe693b07e..fcc053120343bbd6d32672497063bb9dc403d39a 100644 (file)
@@ -37,12 +37,11 @@ python() {
     workdir = os.path.join(tempdir, 'workdir')
     d.setVar('WORKDIR', workdir)
     if not d.getVar('S').startswith(workdir):
+        d.setVar('UNPACKDIR', os.path.join(workdir, 'sources'))
         # Usually a shared workdir recipe (kernel, gcc)
         # Try to set a reasonable default
         if bb.data.inherits_class('kernel', d):
-            d.setVar('S', '${WORKDIR}/source')
-        else:
-            d.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S')))
+            d.setVar('S', '${UNPACKDIR}/source')
     if bb.data.inherits_class('kernel', d):
         # We don't want to move the source to STAGING_KERNEL_DIR here
         d.setVar('STAGING_KERNEL_DIR', '${S}')