mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-05-06 16:09:48 +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.
|
# and if the files have not changed since then.
|
||||||
# This uses GNU 'touch' syntax 'touch -d@N FILE',
|
# This uses GNU 'touch' syntax 'touch -d@N FILE',
|
||||||
# where N is the number of seconds since 1970.
|
# 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:
|
set-timestamps:
|
||||||
-TZ=UTC0 && export TZ && files=`git ls-files` && \
|
-files=`git ls-files` && \
|
||||||
touch -d @1 test.out && rm -f test.out && \
|
touch -d @1 test.out && rm -f test.out && \
|
||||||
for file in $$files; do \
|
for file in $$files; do \
|
||||||
test -z "`git diff --name-only $$file`" || continue; \
|
if git diff --quiet $$file; then \
|
||||||
cmd="touch -d @`git log -1 --format='format:%ct' $$file \
|
time=`git log -1 --format='tformat:%ct' $$file` && \
|
||||||
` $$file" && \
|
touch -cmd @$$time $$file; \
|
||||||
echo "$$cmd" && \
|
else \
|
||||||
$$cmd || exit; \
|
echo >&2 "$$file: warning: does not match repository"; \
|
||||||
|
fi || exit; \
|
||||||
done
|
done
|
||||||
|
|
||||||
# The zics below ensure that each data file can stand on its own.
|
# The zics below ensure that each data file can stand on its own.
|
||||||
|
|||||||
2
NEWS
2
NEWS
@@ -28,6 +28,8 @@ Unreleased, experimental changes
|
|||||||
done differently, and tags would either not have a simple name or
|
done differently, and tags would either not have a simple name or
|
||||||
not exactly match what was released.
|
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
|
Release 2013e - 2013-09-19 23:50:04 -0700
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user