[PROPOSED 1/6] * Makefile: Modernize comment.
--- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2130582c..502fe2fa 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,11 @@ # To affect how this Makefile works, you can run a shell script like this: # # #!/bin/sh -# make CC='gcc -std=gnu23' "$@" +# make CFLAGS='-O2 -DHAVE_GETTEXT=0' "$@" # -# This example script is appropriate for a circa 2024 GNU/Linux system -# where a non-default setting enables this package's optional use of C23. +# This example script is appropriate for a GNU/Linux system +# which needs more optimization than default, and which does not want +# gettext's internationalion of diagnostics. # # Alternatively, you can simply edit this Makefile to tailor the following # macro definitions. -- 2.48.1
When building *.asc, *.gz, and *.lz files for distribution, the files themselves now have reproducible timestamps. Do this by creating new *.t files that have the timestamps for when the other files were created. Formerly, only tarball contents had reproducible timestamps. * Makefile (clean_misc): Remove *.t files too. (TRADITIONAL_ASC, REARGUARD_ASC, ALL_ASC): Create new *.t files to be the timestamps of creation for the files with the reproducible timestamps. (tarballs_version, rearguard_tarballs_version) (traditional_tarballs_version, tailored_tarballs_version) (tzcode$(VERSION).tar.gz.t, tzdata$(VERSION).tar.gz.t) (tzdata$(VERSION)-rearguard.tar.gz.t) (tzdata$(VERSION)-tailored.tar.gz.t, tzdb-$(VERSION).tar.lz.t) (tzcode$(VERSION).tar.gz.asc.t, tzdata$(VERSION).tar.gz.asc.t) (tzdata$(VERSION)-rearguard.tar.gz.asc.t) (tzdb-$(VERSION).tar.lz.asc.t, $(ALL_ASC)): Each *.tar.gz and *.tar.lz file now has the newest timestamps of any of the tarball contents. Each *.asc file now has the same timestamp as the file it checksums. --- Makefile | 68 ++++++++++++++++++++++++++++++++------------------------ NEWS | 9 ++++++++ 2 files changed, 48 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 502fe2fa..5b05877c 100644 --- a/Makefile +++ b/Makefile @@ -1032,7 +1032,7 @@ zishrink-posix.ck zishrink-right.ck: \ clean_misc: rm -fr *.ckd *.dir - rm -f *.ck *.core *.o *.out core core.* \ + rm -f *.ck *.core *.o *.out *.t core core.* \ date tzdir.h tzselect version.h zdump zic libtz.a clean: clean_misc rm -fr tzdb-*/ @@ -1208,12 +1208,12 @@ $(TIME_T_ALTERNATIVES): $(VERSION_DEPS) touch $@ TRADITIONAL_ASC = \ - tzcode$(VERSION).tar.gz.asc \ - tzdata$(VERSION).tar.gz.asc + tzcode$(VERSION).tar.gz.asc.t \ + tzdata$(VERSION).tar.gz.asc.t REARGUARD_ASC = \ - tzdata$(VERSION)-rearguard.tar.gz.asc + tzdata$(VERSION)-rearguard.tar.gz.asc.t ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ - tzdb-$(VERSION).tar.lz.asc + tzdb-$(VERSION).tar.lz.asc.t tarballs rearguard_tarballs tailored_tarballs traditional_tarballs \ signatures rearguard_signatures traditional_signatures: \ @@ -1225,29 +1225,31 @@ signatures rearguard_signatures traditional_signatures: \ # other means. Ordinarily these rules are used only by the above # non-_version rules, which set VERSION on the 'make' command line. tarballs_version: traditional_tarballs_version rearguard_tarballs_version \ - tzdb-$(VERSION).tar.lz + tzdb-$(VERSION).tar.lz.t rearguard_tarballs_version: \ - tzdata$(VERSION)-rearguard.tar.gz + tzdata$(VERSION)-rearguard.tar.gz.t traditional_tarballs_version: \ - tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz + tzcode$(VERSION).tar.gz.t tzdata$(VERSION).tar.gz.t tailored_tarballs_version: \ - tzdata$(VERSION)-tailored.tar.gz + tzdata$(VERSION)-tailored.tar.gz.t signatures_version: $(ALL_ASC) rearguard_signatures_version: $(REARGUARD_ASC) traditional_signatures_version: $(TRADITIONAL_ASC) -tzcode$(VERSION).tar.gz: set-timestamps.out +tzcode$(VERSION).tar.gz.t: set-timestamps.out $(SETUP_TAR) && \ $$TAR -cf - \ $(COMMON) $(DOCS) $(SOURCES) | \ - gzip $(GZIPFLAGS) >$@.out - mv $@.out $@ + gzip $(GZIPFLAGS) >$(@:.t=) + $(SET_TIMESTAMP) $(@:.t=) $(COMMON) $(DOCS) $(SOURCES) + touch $@ -tzdata$(VERSION).tar.gz: set-timestamps.out +tzdata$(VERSION).tar.gz.t: set-timestamps.out $(SETUP_TAR) && \ $$TAR -cf - $(TZDATA_DIST) | \ - gzip $(GZIPFLAGS) >$@.out - mv $@.out $@ + gzip $(GZIPFLAGS) >$(@:.t=) + $(SET_TIMESTAMP) $(@:.t=) $(TZDATA_DIST) + touch $@ # Create empty files with a reproducible timestamp. CREATE_EMPTY = TZ=UTC0 touch -mt 202010122253.00 @@ -1256,7 +1258,7 @@ CREATE_EMPTY = TZ=UTC0 touch -mt 202010122253.00 # for backwards compatibility with tz releases 2018e through 2022a. # They should go away eventually. To build rearguard tarballs you # can instead use 'make DATAFORM=rearguard tailored_tarballs'. -tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out +tzdata$(VERSION)-rearguard.tar.gz.t: rearguard.zi set-timestamps.out rm -fr $@.dir mkdir $@.dir ln $(TZDATA_DIST) $@.dir @@ -1274,8 +1276,11 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out (cd $@.dir && \ $$TAR -cf - \ $(TZDATA_DIST) pacificnew | \ - gzip $(GZIPFLAGS)) >$@.out - mv $@.out $@ + gzip $(GZIPFLAGS)) >$(@:.t=) + $(SET_TIMESTAMP) $(@:.t=) \ + $$(cd $@.dir && \ + ls $(TZDATA_DIST) pacificnew | sed 's,^,$@.dir/,') + touch $@ # Create a tailored tarball suitable for TZUpdater and compatible tools. # For example, 'make DATAFORM=vanguard tailored_tarballs' makes a tarball @@ -1284,7 +1289,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out # traditional tarball, as data entries are put into 'etcetera' even if they # came from some other source file. However, the effect should be the same # for ordinary use, which reads all the source files. -tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out +tzdata$(VERSION)-tailored.tar.gz.t: set-timestamps.out rm -fr $@.dir mkdir $@.dir : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. @@ -1317,24 +1322,29 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out ln $$links $@.dir $(SETUP_TAR) && \ (cd $@.dir && \ - $$TAR -cf - * | gzip $(GZIPFLAGS)) >$@.out - mv $@.out $@ + $$TAR -cf - *) | gzip $(GZIPFLAGS) >$(@:.t=) + $(SET_TIMESTAMP) $(@:.t=) \ + $$(cd $@.dir && ls * | sed 's,^,$@.dir/,') + touch $@ -tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out +tzdb-$(VERSION).tar.lz.t: set-timestamps.out set-tzs-timestamp.out rm -fr tzdb-$(VERSION) mkdir tzdb-$(VERSION) ln $(ENCHILADA) tzdb-$(VERSION) $(SET_TIMESTAMP) tzdb-$(VERSION) tzdb-$(VERSION)/* $(SETUP_TAR) && \ - $$TAR -cf - tzdb-$(VERSION) | lzip -9 >$@.out - mv $@.out $@ + $$TAR -cf - tzdb-$(VERSION) | lzip -9 >$(@:.t=) + $(SET_TIMESTAMP) $(@:.t=) tzdb-$(VERSION) + touch $@ -tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz -tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz -tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz -tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz +tzcode$(VERSION).tar.gz.asc.t: tzcode$(VERSION).tar.gz.t +tzdata$(VERSION).tar.gz.asc.t: tzdata$(VERSION).tar.gz.t +tzdata$(VERSION)-rearguard.tar.gz.asc.t: tzdata$(VERSION)-rearguard.tar.gz.t +tzdb-$(VERSION).tar.lz.asc.t: tzdb-$(VERSION).tar.lz.t $(ALL_ASC): - $(GPG) --armor --detach-sign $? + $(GPG) --armor --detach-sign $(?:.t=) + $(SET_TIMESTAMP) $(@:.t=) $(?:.t=) + touch $@ TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T typecheck: long-long.ck unsigned.ck diff --git a/NEWS b/NEWS index 8c077164..071659c8 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ News for the tz database +Unreleased, experimental changes + + Changes to build procedure + + Distribution products (*.asc, *.gz, and *.lz) now have + reproducible timestamps. Formerly, only the contents of the + compressed tarballs had reproducible timestamps. + + Release 2025b - 2025-03-22 13:40:46 -0700 Briefly: -- 2.48.1
* Makefile (set-timestamps.out): Use --date=format-local:..., not --date=format:..., because TZ is UTC0 and we want UTC not the committer’s local time. --- Makefile | 2 +- NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5b05877c..079bb530 100644 --- a/Makefile +++ b/Makefile @@ -1109,7 +1109,7 @@ set-timestamps.out: $(EIGHT_YARDS) if git diff --quiet HEAD $$file; then \ time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ - --date='format:%Y-%m-%dT%H:%M:%SZ' \ + --date='format-local:%Y-%m-%dT%H:%M:%SZ' \ $$file) && \ echo "+ touch -md $$time $$file" && \ touch -md $$time $$file; \ diff --git a/NEWS b/NEWS index 071659c8..7a05aeb9 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ Unreleased, experimental changes Changes to build procedure + Files in distributed tarballs now have correct commit times. + Formerly, the committer's time zone was incorrectly ignored. + Distribution products (*.asc, *.gz, and *.lz) now have reproducible timestamps. Formerly, only the contents of the compressed tarballs had reproducible timestamps. -- 2.48.1
* Makefile (white-space.ck): Use make substitution, not shell substitution, to omit leap-seconds.list. This makes the output of 'make' easier to understand. --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 079bb530..741c730b 100644 --- a/Makefile +++ b/Makefile @@ -889,11 +889,9 @@ character-set.ck: $(ENCHILADA) white-space.ck: $(ENCHILADA) $(UTF8_LOCALE_MISSING) || { \ - enchilada='$(ENCHILADA)' && \ patfmt=' \t|[\f\r\v]' && pat=$$(printf "$$patfmt\\n") && \ ! grep -En "$$pat|[$s]\$$" \ - $${enchilada%leap-seconds.list*} \ - $${enchilada#*leap-seconds.list}; \ + $(ENCHILADA:leap-seconds.list=); \ } touch $@ -- 2.48.1
* Makefile (tzdata$(VERSION)-tailored.tar.gz.t): Use sed, not grep, so that building tarballs no longer depends on having grep; it already depends on sed elsewhere. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 741c730b..b8029429 100644 --- a/Makefile +++ b/Makefile @@ -1299,7 +1299,7 @@ tzdata$(VERSION)-tailored.tar.gz.t: set-timestamps.out cd $@.dir && \ $(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \ $$pacificnew - (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ + (sed '/^#/!d' tzdata.zi && echo && cat $(DATAFORM).zi) \ >$@.dir/etcetera touch -mr tzdata.zi $@.dir/etcetera sed -n \ -- 2.48.1
* tzselect.ksh (translit): Use ‘:’, not ‘true’, so as to not depend on having ‘true’. --- tzselect.ksh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tzselect.ksh b/tzselect.ksh index ca3d82c6..7cd8679d 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -161,15 +161,15 @@ case $# in *) say >&2 "$0: $1: unknown argument"; exit 1 esac -# translit=true to try transliteration. +# translit=: to try transliteration. # This is false if U+12345 CUNEIFORM SIGN URU TIMES KI has length 1 # which means the shell and (presumably) awk do not need transliteration. -# It is true if the byte string has some other length in characters, or +# It is ':' if the byte string has some other length in characters, or # if this is a POSIX.1-2017 or earlier shell that does not support $'...'. CUNEIFORM_SIGN_URU_TIMES_KI=$'\360\222\215\205' if test ${#CUNEIFORM_SIGN_URU_TIMES_KI} = 1 then translit=false -else translit=true +else translit=: fi # Read into shell variable $1 the contents of file $2. -- 2.48.1
On Mon, Apr 21, 2025 at 01:33:44AM -0700, Paul Eggert via tz wrote:
--- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 2130582c..502fe2fa 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,11 @@ # To affect how this Makefile works, you can run a shell script like this: # # #!/bin/sh -# make CC='gcc -std=gnu23' "$@" +# make CFLAGS='-O2 -DHAVE_GETTEXT=0' "$@" # -# This example script is appropriate for a circa 2024 GNU/Linux system -# where a non-default setting enables this package's optional use of C23. +# This example script is appropriate for a GNU/Linux system +# which needs more optimization than default, and which does not want +# gettext's internationalion of diagnostics.
I suppose internationalion is a typo? /MF
participants (2)
-
Magnus Fromreide -
Paul Eggert