]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
file: fix the way path is written to environment-setup.d
authorOleksandr Hnatiuk <ohnatiuk@cisco.com>
Tue, 25 Jul 2023 16:51:48 +0000 (09:51 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Jul 2023 20:07:18 +0000 (21:07 +0100)
$OECORE_NATIVE_SYSROOT is not escaped, thus it is expanded to an empty string.
This happens to work because we have ${datadir} which in this context is
relocated to the buildtools sysroot after installation of buildtools.

If the $ before OECORE_NATIVE_SYSROOT is escaped, it will be saved to file.sh
as intended, but MAGIC will point to the wrong location because both
OECORE_NATIVE_SYSROOT and datadir resolve to sysroot which doubles the path
like so:
/path/to/buildtools/sysroots/x86_64-xesdk-linux/path/to/buildtools/sysroots/x86_64-xesdk-linux/usr/share/misc/magic.mgc
which does not exist. So, removing reference to OECORE_NATIVE_SYSROOT.

Signed-off-by: Oleksandr Hnatiuk <ohnatiuk@cisco.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-devtools/file/file_5.44.bb

index 08343842307c0c811457e26771d7b1ec7ee9cafc..3ce266475b23102a74acc67d2be1fc0f4b368a65 100644 (file)
@@ -48,7 +48,7 @@ do_install:append:class-nativesdk() {
        create_wrapper ${D}/${bindir}/file MAGIC=${datadir}/misc/magic.mgc
        mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
        cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh
-               export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
+               export MAGIC="${datadir}/misc/magic.mgc"
        EOF
 }