From a0ecc14f30d54a1908636886b040bcdd7b69f911 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Thu, 2 Jun 2022 16:08:16 +0200 Subject: [PATCH] Minor fixes for qt-configure-module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put quotes around args var and add e and u flags, which do the following: e - terminates the script if an error occurs. This is certainly desirable behavior. We don't want the script to chug along with unpredictable behavior if an error occurred. u - terminates the script if an undefined variable is encountered. It is also desirable to terminate here because it might lead to unexpected behavior. Change-Id: Ia02196ef3eab64521e36771530d033a15bb40ecc Reviewed-by: Alexandru Croitor Reviewed-by: Jörg Bornemann --- bin/qt-configure-module.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/qt-configure-module.in b/bin/qt-configure-module.in index cdd350ea22..d0a2f3bdf4 100755 --- a/bin/qt-configure-module.in +++ b/bin/qt-configure-module.in @@ -1,4 +1,6 @@ #!/bin/sh +set -eu + script_dir_path=`dirname $0` script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` @@ -28,7 +30,7 @@ fi optfile=config.opt echo > "$optfile" for arg in "$@"; do -echo $arg >> "$optfile" +echo "$arg" >> "$optfile" done cmake_script_path="$script_dir_path/@__relative_path_to_cmake_scripts_dir@/QtProcessConfigureArgs.cmake"