summaryrefslogtreecommitdiffhomepage
path: root/subr/rtl_complex.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-04-04 19:45:50 +0100
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-04-04 19:45:50 +0100
commitb03d3cc271d6c91e2d64adeb6b7ed742fa26066e (patch)
tree5f190274d04bf957230bf4a809b91b0b444625ad /subr/rtl_complex.subr
parent2ec32931cedeeab8cc896576956e351574b69803 (diff)
downloadmidipix_build-b03d3cc271d6c91e2d64adeb6b7ed742fa26066e.tar.bz2
midipix_build-b03d3cc271d6c91e2d64adeb6b7ed742fa26066e.tar.xz
subr/rtl_complex.subr:rtl_is_newer(): reimplemented w/ stat(1).
subr/build_init.subr:buildp_init_prereqs(): adds stat(1).
Diffstat (limited to 'subr/rtl_complex.subr')
-rw-r--r--subr/rtl_complex.subr13
1 files changed, 9 insertions, 4 deletions
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;
};