From 34a066b6e38e5135d63b321369c50a1f9ec2e808 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 4 Nov 2024 13:45:17 +0000 Subject: [PATCH] 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 --- scripts/sanitizer-env.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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 -- 2.47.2