]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toolchain-scripts/meta-ide-support: Handle dash shells correctly
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 May 2018 17:54:46 +0000 (18:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 4 May 2018 08:54:48 +0000 (09:54 +0100)
Where /bin/sh is dash, the recent toolchain scripts change fails as the $(pwd)
usage in oe-init-build-env doesn't function correctly. Fix this by saving
and restoring the cwd and calling the script within its own directory.

This fixes meta-ide-support on dash based systems.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toolchain-scripts.bbclass

index ee411ddca014af69e3995d7c4679df1f59d94ec0..71da5e5409293115881ae1bccdb9fe874d46ecb7 100644 (file)
@@ -62,7 +62,7 @@ toolchain_create_tree_env_script () {
        script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
        rm -f $script
        touch $script
-       echo ". ${COREBASE}/oe-init-build-env ${TOPDIR}" >> $script
+       echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script
        echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
        echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script