1
0
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:
Paul Eggert
2013-09-23 10:58:56 -07:00
parent bdf636b211
commit 8ea4850bf6
2 changed files with 10 additions and 7 deletions

View File

@ -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.

2
NEWS
View File

@ -28,6 +28,8 @@ Unreleased, experimental changes
done differently, and tags would either not have a simple name or
not exactly match what was released.
'make set-timestamps' is now simpler and a bit more portable.
Release 2013e - 2013-09-19 23:50:04 -0700