2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

build-package: further fixes for Darwin/*BSD compat

This commit is contained in:
Christopher Roy Bratusek 2020-08-18 21:04:59 +02:00
parent e2b250d560
commit be6ea8be55
2 changed files with 9 additions and 3 deletions

View File

@ -10,8 +10,14 @@ CWD=$(readlink -n "${BASH_SOURCE[0]}")
CWD=$(dirname "${CWD}")
case $(uname -s) in
*Darwin*) export sumsha256="shasum -a 256" ;;
* ) export sumsha256="sha256sum" ;;
*Darwin* | *BSD* )
export sumsha256="shasum -a 256"
export statx="stat -f %Z"
;;
*Linux* )
export sumsha256="sha256sum"
export statx="stat -c %Z"
;;
esac
# DIRS

View File

@ -58,7 +58,7 @@ index_update_required () {
index_file=${1}
test ! -f ${index_file} && return 0
test $(stat --format=%Z ${index_file}) -le $(($(date +%s) - 3600)) && return 0
test $(${statx} ${index_file}) -le $(($(date +%s) - 3600)) && return 0
test "$(file -b ${index_file})" == "empty" && return 0
return 1