mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-11-20 18:46:07 +00:00
dist: 'make set-timestamps' cleanup
* Makefile (set-timestamps): Use git's tformat rather than format, to port to strict POSIX hosts where `` output in shell scripts cannot end in a non-newline. Use git diff --quiet rather than git diff --name-only, as it's simpler. Use touch -c for safety, and -m to avoid setting last-access time, which we don't care about. Diagnose files that don't match repository. * NEWS: Document this.
This commit is contained in:
15
Makefile
15
Makefile
@ -472,16 +472,17 @@ public: check check_public check_time_t_alternatives \
|
||||
# and if the files have not changed since then.
|
||||
# This uses GNU 'touch' syntax 'touch -d@N FILE',
|
||||
# where N is the number of seconds since 1970.
|
||||
# If git or GNU 'touch' is absent, do nothing.
|
||||
# If git or GNU 'touch' is absent, do nothing and fail.
|
||||
set-timestamps:
|
||||
-TZ=UTC0 && export TZ && files=`git ls-files` && \
|
||||
-files=`git ls-files` && \
|
||||
touch -d @1 test.out && rm -f test.out && \
|
||||
for file in $$files; do \
|
||||
test -z "`git diff --name-only $$file`" || continue; \
|
||||
cmd="touch -d @`git log -1 --format='format:%ct' $$file \
|
||||
` $$file" && \
|
||||
echo "$$cmd" && \
|
||||
$$cmd || exit; \
|
||||
if git diff --quiet $$file; then \
|
||||
time=`git log -1 --format='tformat:%ct' $$file` && \
|
||||
touch -cmd @$$time $$file; \
|
||||
else \
|
||||
echo >&2 "$$file: warning: does not match repository"; \
|
||||
fi || exit; \
|
||||
done
|
||||
|
||||
# The zics below ensure that each data file can stand on its own.
|
||||
|
||||
Reference in New Issue
Block a user