diff options
-rw-r--r-- | subr/build_init.subr | 2 | ||||
-rw-r--r-- | subr/rtl_complex.subr | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index 49f0dca8..668c0861 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -229,7 +229,7 @@ buildp_init_prereqs() { g++ gcc git grep gunzip gzip hostname id install kill \ ln lzip make mkdir mkfifo mktemp mv paste patch perl \ pgrep pkill printf readlink rm sed sha256sum sort \ - tail tar test touch tr uniq wget xz zip; then + stat tail tar test touch tr uniq wget xz zip; then printf "%s\n" "${_status}" >&2; exit 1; elif ! (FNAME="$(mktemp)" && { trap "rm -f \"\${FNAME}\"" EXIT; \ sed -i'' -e '' "${FNAME}" >/dev/null 2>&1; }); then diff --git a/subr/rtl_complex.subr b/subr/rtl_complex.subr index 2c23cfe8..4a055515 100644 --- a/subr/rtl_complex.subr +++ b/subr/rtl_complex.subr @@ -164,11 +164,16 @@ rtl_head() { }; rtl_is_newer() { - local _new_fname="${1}" _old_fname="${2}"; - if [ -n "$(find -name "${_new_fname}" -newer "${_old_fname}" 2>/dev/null)" ]; then + local _new_fname="${1}" _old_fname="${2}" _new_ts="" _old_ts=""; + if ! [ -e "${_old_fname}" ]; then return 0; - else - return 1; + else _new_ts="$(stat -c %Y "${_new_fname}" 2>&1)"; + _old_ts="$(stat -c %Y "${_old_fname}" 2>&1)"; + if [ "${_new_ts:-0}" -gt "${_old_ts:-0}" ]; then + return 0; + else + return 1; + fi; fi; }; |