]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
toolchain-scripts: compatibility with unbound variable protection
authorJan Kircher <openembedded@hetsh.de>
Tue, 10 Jan 2023 16:11:18 +0000 (17:11 +0100)
committerSteve Sakoman <steve@sakoman.com>
Fri, 20 Jan 2023 02:28:32 +0000 (16:28 -1000)
Fixed an error when Bash's unbound variable protection is enabled (set -u) and variable "LD_LIBRARY_PATH" does not exist.

Signed-off-by: Jan Kircher <openembedded@hetsh.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 85685370b0ad93291cda59fb091a15eeecf5e0d5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes-recipe/toolchain-scripts.bbclass

index 3cc823fe63d31ac3ac3f1f9c6d83960eee6b6062..fa658a6596e1f0f45b718dd9ebd90c136fbdafbb 100644 (file)
@@ -37,7 +37,7 @@ toolchain_create_sdk_env_script () {
        echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script
        echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script
        echo '# Only disable this check if you are absolutely know what you are doing!' >> $script
-       echo 'if [ ! -z "$LD_LIBRARY_PATH" ]; then' >> $script
+       echo 'if [ ! -z "${LD_LIBRARY_PATH:-}" ]; then' >> $script
        echo "    echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script
        echo "    echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script
        echo '    echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script