Merge pull request #8 from jbeich/bsd

Unbreak build on FreeBSD
This commit is contained in:
toast2903 2023-06-23 17:33:18 -04:00 committed by GitHub
commit 73fcec9bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@ if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
execute_process( execute_process(
COMMAND 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 COMMAND_ERROR_IS_FATAL ANY
) )
endif() endif()

View File

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

View File

@ -24,7 +24,7 @@ execute_process(
string(REPLACE "\n" "" TZ_COMMIT_TIME "${TZ_COMMIT_TIME}") string(REPLACE "\n" "" TZ_COMMIT_TIME "${TZ_COMMIT_TIME}")
if (APPLE) if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
set(VERSION_COMMAND ${GNU_DATE} -r ${TZ_COMMIT_TIME} +%y%m%d) set(VERSION_COMMAND ${GNU_DATE} -r ${TZ_COMMIT_TIME} +%y%m%d)
else () else ()
set(VERSION_COMMAND ${GNU_DATE} +%y%m%d --date=@${TZ_COMMIT_TIME}) set(VERSION_COMMAND ${GNU_DATE} +%y%m%d --date=@${TZ_COMMIT_TIME})
@ -50,7 +50,7 @@ add_custom_command(
OUTPUT OUTPUT
${BINARY_LIST_TXT} ${BINARY_LIST_TXT}
COMMAND 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 WORKING_DIRECTORY
${NX_ZONEINFO_DIR}) ${NX_ZONEINFO_DIR})

View File

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