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

merge-requests/33/head
Christopher Roy Bratusek 4 years ago
parent e2b250d560
commit be6ea8be55

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

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

Loading…
Cancel
Save