Minor fixes for qt-configure-module

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 <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
David Skoland 2022-06-02 16:08:16 +02:00
parent 4a14a9c014
commit a0ecc14f30

View File

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/sh
set -eu
script_dir_path=`dirname $0` script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
@ -28,7 +30,7 @@ fi
optfile=config.opt optfile=config.opt
echo > "$optfile" echo > "$optfile"
for arg in "$@"; do for arg in "$@"; do
echo $arg >> "$optfile" echo "$arg" >> "$optfile"
done done
cmake_script_path="$script_dir_path/@__relative_path_to_cmake_scripts_dir@/QtProcessConfigureArgs.cmake" cmake_script_path="$script_dir_path/@__relative_path_to_cmake_scripts_dir@/QtProcessConfigureArgs.cmake"