=== modified file 'common.zsh' --- common.zsh 2017-11-15 16:41:23 +0000 +++ common.zsh 2017-11-15 16:33:59 +0000 @@ -2,12 +2,13 @@ setopt no_unset warn_create_global extended_glob set -x -typeset -g DO FILE BASE OUT FUNCDIR +typeset -g DO FILE BASE OUT FUNCDIR META_MTIME_REF DO=$0 FILE=$1 BASE=$2 OUT=$3 FUNCDIR=${0:h:a}/functions +META_MTIME_REF= # helper that prints out error message and exits die() { @@ -48,6 +49,9 @@ arglist+=( "$k=$vars[$k]" ) done printf >$OUT "%s" "${(j::)arglist}" + if [[ -n $META_MTIME_REF ]]; then + touch -r $META_MTIME_REF $OUT || die + fi exit 0 } === modified file 'default.download-file.do' --- default.download-file.do 2017-11-15 16:41:23 +0000 +++ default.download-file.do 2017-11-15 16:33:59 +0000 @@ -10,6 +10,7 @@ wget --timestamping --force-directories --protocol-directories -P downloads $vars[url] \ || die "Failed to fetch ${(qqq)vars[url]}" + META_MTIME_REF=$vars[filename] } . ./common.zsh # vim: fileencoding=utf8 ft=zsh noet sw=4 ts=4 sts=4