]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
scripts/sanitizer-env.sh: convert to heredoc
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 4 Nov 2024 13:45:17 +0000 (13:45 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 7 Nov 2024 17:07:41 +0000 (11:07 -0600)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/219
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
scripts/sanitizer-env.sh

index dc1103dfa4daa0804d078f21a116c055a379c967..8a3a7d9736d033459d999dd48c45d17a13142b77 100755 (executable)
@@ -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