Closed m42e closed 8 years ago
stat -f "%m %c"
produces strange output for me. GNU stat differs from the mac version of stat and I think we can't use it to produce timestamp. However the REALFILE thing seems quite handy and it could be used to figure out ZGEN_SOURCE
.
Fixing the "strange output" is trivial, just detect if it's GNU's stat? (not 100% tested, but should be right):
`stat --version` && stat_cmd="stat -c '%Y %W'" || stat_cmd="stat -f '%m %B'"
CHANGESHA=`$stat_cmd ${REALFILE}`
echo "if [[ \"\`$stat_cmd ${REALFILE}\`\" != \"$CHANGESHA\" ]]; then" >> "${ZGEN_INIT}"
Fixed it as @pearofducks suggested.
We got a (somewhat) working implementation merged on #60
shasum is to slow, and creation and changedate seems to be exactly enough. See #46