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(
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

@ -24,7 +24,7 @@ execute_process(
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)
else ()
set(VERSION_COMMAND ${GNU_DATE} +%y%m%d --date=@${TZ_COMMIT_TIME})
@ -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