]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
meta/classes-recipe/toolchain-scripts.bbclass: eliminate bash-ism
authorAlexander Kanavin <alex@linutronix.de>
Tue, 7 Oct 2025 18:21:42 +0000 (20:21 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Oct 2025 09:27:02 +0000 (10:27 +0100)
Sourcing a script with arguments is a non-standard bash extension
and doesn't work with other shells (e.g. dash, which is used on
Debian and derivatives). This used to work by coincidence when
running against integrated poky repo without having to separately
specify where bitbake is, but no longer does.

Using set is a POSIX standard.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/toolchain-scripts.bbclass

index ec040b5ebbe20252e6735999e9ce5d4e11c2eaa5..8c062ef0e74f5f384fe151ef09d3cd3864f62823 100644 (file)
@@ -92,7 +92,7 @@ toolchain_create_tree_env_script () {
        touch $script
        echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script
        echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script
-       echo "orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR} $bitbakedir; cd \$orig" >> $script
+       echo "orig=`pwd`; cd ${COREBASE}; set ${TOPDIR} $bitbakedir; . ./oe-init-build-env; cd \$orig" >> $script
        echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script
        echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script