]> git.cworth.org Git - notmuch/commitdiff
make release archive: common (or no) timestamps
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 12 Dec 2017 06:39:20 +0000 (08:39 +0200)
committerDavid Bremner <david@tethera.net>
Thu, 28 Dec 2017 14:12:21 +0000 (10:12 -0400)
The appended file 'version' has the same timestamp as the files added
by `git archive`.

The original file name and time stamp are no longer saved to the
gzip header in resulting $(PACKAGE)-$(VERSION).tar.gz file.

When build environment is close enough to another, this may
provide mutually reproducible release archive files.

Makefile.local

index 9505b7fee70b43b281bf5e6b428dfb7c522b14c2..1535c2ae8a7bcbe53ccfaa38efcdf2721ca28267 100644 (file)
@@ -31,11 +31,12 @@ $(TAR_FILE):
        fi ; \
        git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ $$ref > $(TAR_FILE).tmp
        echo $(VERSION) > version.tmp
+       ct=`git --no-pager log -1 --pretty=format:%ct $$ref` ; \
        tar --owner root --group root --append -f $(TAR_FILE).tmp \
                --transform s_^_$(PACKAGE)-$(VERSION)/_  \
-               --transform 's_.tmp$$__' version.tmp
+               --transform 's_.tmp$$__' --mtime=@$$ct version.tmp
        rm version.tmp
-       gzip < $(TAR_FILE).tmp > $(TAR_FILE)
+       gzip -n < $(TAR_FILE).tmp > $(TAR_FILE)
        @echo "Source is ready for release in $(TAR_FILE)"
 
 $(SHA256_FILE): $(TAR_FILE)