From: Emil Velikov Date: Mon, 4 Nov 2024 13:45:17 +0000 (+0000) Subject: scripts/sanitizer-env.sh: convert to heredoc X-Git-Tag: v34~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34a066b6e38e5135d63b321369c50a1f9ec2e808;p=thirdparty%2Fkmod.git scripts/sanitizer-env.sh: convert to heredoc Convert to heredoc and add leading/trailing blank lines so it stands out from the rest. It makes for cleaner reading experience both of the script itself and its output. As suggested by Lucas. v2: - don't escape ", drop spurious instance Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/219 Signed-off-by: Lucas De Marchi --- diff --git a/scripts/sanitizer-env.sh b/scripts/sanitizer-env.sh index dc1103df..8a3a7d97 100755 --- a/scripts/sanitizer-env.sh +++ b/scripts/sanitizer-env.sh @@ -7,9 +7,12 @@ if [[ ${CC-} == *gcc* ]]; then elif [[ ${CC-} == *clang* ]]; then OUR_PRELOAD=$("$CC" -print-file-name=libclang_rt.asan-x86_64.so) else - echo "Unknown compiler CC=\"${CC-}\" - gcc and clang are supported." - echo "Assuming \"gcc\", manually set the variable and retry if needed." - echo + cat <<- EOF + + Unknown compiler CC="${CC-}" - gcc and clang are supported. + Assuming "gcc", manually set the variable and retry if needed. + +EOF OUR_PRELOAD=$(gcc -print-file-name=libasan.so) fi @@ -23,7 +26,11 @@ if test -n "$OUR_PRELOAD"; then LD_PRELOAD=${LD_PRELOAD+${LD_PRELOAD}:}$OUR_PRELOAD export LD_PRELOAD - echo "LD_PRELOAD has been set to \"$LD_PRELOAD\"." - echo "The sanitizer might report issues with ANY process you execute." + cat <<- EOF + + LD_PRELOAD has been set to "$LD_PRELOAD". + The sanitizer might report issues with ANY process you execute. + +EOF fi unset OUR_PRELOAD