From: Jan Kircher Date: Tue, 10 Jan 2023 16:11:18 +0000 (+0100) Subject: toolchain-scripts: compatibility with unbound variable protection X-Git-Tag: 2022-10.3-langdale~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00356d24516a34860e12975e4652e483edcae611;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git toolchain-scripts: compatibility with unbound variable protection 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie (cherry picked from commit 85685370b0ad93291cda59fb091a15eeecf5e0d5) Signed-off-by: Steve Sakoman --- diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 3cc823fe63d..fa658a6596e 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -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