Switch to POSIX sh for scripts

- GNU `bash` may not be installed or installed outside of /bin
- *.sh only use `==` from Bash, so /bin/sh is enough
This commit is contained in:
Jan Beich 2023-06-23 19:21:52 +00:00
parent 8c272f21d1
commit 6ca7f92b0e
4 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
execute_process(
COMMAND
/bin/bash "${CMAKE_CURRENT_SOURCE_DIR}/find_tzif.sh" "${TZ_ZONEINFO_DIR}" "${TZIF_LIST_FILE}"
sh "${CMAKE_CURRENT_SOURCE_DIR}/find_tzif.sh" "${TZ_ZONEINFO_DIR}" "${TZIF_LIST_FILE}"
COMMAND_ERROR_IS_FATAL ANY
)
endif()

View File

@ -1,4 +1,4 @@
#/bin/bash
#/bin/sh
set -e
directory=$1
tzif_list=$2
@ -7,7 +7,7 @@ truncate -s 0 $tzif_list
for i in `find $directory -type f`; do
header=`head -c 4 $i`
if [ "$header" == "TZif" ]; then
if [ "$header" = "TZif" ]; then
echo "$i" >> $tzif_list
fi
done

View File

@ -50,7 +50,7 @@ add_custom_command(
OUTPUT
${BINARY_LIST_TXT}
COMMAND
bash ${CMAKE_CURRENT_SOURCE_DIR}/generate_binary_list_txt.sh ${BINARY_LIST_TXT}
sh ${CMAKE_CURRENT_SOURCE_DIR}/generate_binary_list_txt.sh ${BINARY_LIST_TXT}
WORKING_DIRECTORY
${NX_ZONEINFO_DIR})

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
BINARY_LIST_TXT="$1"
# Fill text file with zone names
@ -8,7 +8,7 @@ get_files_nx() {
find $target -maxdepth 1 -type f -not -regex '.*Factory' | sort
local DIRS=`find $target -maxdepth 1 -type d | sort`
for i in $DIRS; do
if [ "`readlink -e $i`" == "`readlink -e $target`" ]; then
if [ "`readlink -e $i`" = "`readlink -e $target`" ]; then
continue
fi
get_files_nx $i