1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-10 09:21:58 +02:00

build: support creating reproducible tarball contents

We already support reproducible builds since commit v8.24-99-gc1b3d6587,
and this adjusts that change to also support reproducible
tarball contents with subsequent runs of `make dist`.

* Makefile.am: Don't create a varying .timestamp file, instead ...
* man/local.mk: Rely on the timestamp of the .tarball-version file.
Fixes https://bugs.gnu.org/72232
This commit is contained in:
Pádraig Brady
2024-07-21 18:25:05 +01:00
parent 65a46e9e21
commit 83ec7a706a
2 changed files with 2 additions and 3 deletions

View File

@@ -82,14 +82,12 @@ BUILT_SOURCES = .version
# Have no read-only files in the tarball to allow easy removal. # Have no read-only files in the tarball to allow easy removal.
# Have .tarball-version based versions only in tarball builds. # Have .tarball-version based versions only in tarball builds.
# Have .timestamp based dates only in tarball builds.
# The perl substitution is to change some key uses of "rm" to "/bin/rm". # The perl substitution is to change some key uses of "rm" to "/bin/rm".
# See the rm_subst comment for details. # See the rm_subst comment for details.
# The touch avoids a subtle, spurious "make distcheck" failure. # The touch avoids a subtle, spurious "make distcheck" failure.
dist-hook: gen-ChangeLog dist-hook: gen-ChangeLog
$(AM_V_GEN)chmod -R +rw $(distdir) $(AM_V_GEN)chmod -R +rw $(distdir)
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
$(AM_V_GEN)date +%s > $(distdir)/.timestamp
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
$(AM_V_at)touch $(distdir)/doc/constants.texi \ $(AM_V_at)touch $(distdir)/doc/constants.texi \
$(distdir)/doc/coreutils.info $(distdir)/doc/coreutils.info

View File

@@ -194,7 +194,8 @@ endif
&& $(MKDIR_P) $$t \ && $(MKDIR_P) $$t \
&& (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \ && (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
$$argv$(EXEEXT)) \ $$argv$(EXEEXT)) \
&& : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \ && : $${SOURCE_DATE_EPOCH=`date -r $(srcdir)/.tarball-version +%s \
2>/dev/null || :`} \
&& : $${TZ=UTC0} && export TZ \ && : $${TZ=UTC0} && export TZ \
&& export SOURCE_DATE_EPOCH && $(run_help2man) \ && export SOURCE_DATE_EPOCH && $(run_help2man) \
--source='$(PACKAGE_STRING)' \ --source='$(PACKAGE_STRING)' \