* [PATCH] make release archive: common (or no) timestamps
@ 2017-12-11 17:31 Tomi Ollila
0 siblings, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2017-12-11 17:31 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
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.
---
tested somewhat like:
$ rm -f test.tar.gz
$ make test.tar.gz TAR_FILE=test.tar.gz
$ md5sum test.tar.gz
59b22212dd006d24d09acd98cd18570a
$ sleep 2
$ rm test.tar.gz
$ make test.tar.gz TAR_FILE=test.tar.gz
$ md5sum test.tar.gz
59b22212dd006d24d09acd98cd18570a
$ rm test.tar.gz
( second try, checksums changed :O .. the reason was git-am'ed content
*huh* ;)
Makefile.local | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.local b/Makefile.local
index 9505b7fee70b..49f83bc3feea 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -31,11 +31,13 @@ $(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` ; \
+ touch -d @$$ct version.tmp
tar --owner root --group root --append -f $(TAR_FILE).tmp \
--transform s_^_$(PACKAGE)-$(VERSION)/_ \
--transform 's_.tmp$$__' 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)
--
2.13.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] make release archive: common (or no) timestamps
@ 2017-12-12 6:39 Tomi Ollila
2017-12-28 14:15 ` David Bremner
0 siblings, 1 reply; 3+ messages in thread
From: Tomi Ollila @ 2017-12-12 6:39 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
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.
---
The best way to realize improvements in a patch set is to send it >;/
V2 of id:20171211173102.6279-1-tomi.ollila@iki.fi
Replaces file touch with --mtime= GNU tar(1) option (diffdiff with V1):
: +++ b/Makefile.local
: @@ -34,6 +34,5 @@ $(TAR_FILE):
: ct=`git --no-pager log -1 --pretty=format:%ct $$ref` ; \
: - touch -d @$$ct version.tmp
: 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
Makefile.local | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.local b/Makefile.local
index 9505b7fee70b..1535c2ae8a7b 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -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)
--
2.13.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] make release archive: common (or no) timestamps
2017-12-12 6:39 [PATCH] make release archive: common (or no) timestamps Tomi Ollila
@ 2017-12-28 14:15 ` David Bremner
0 siblings, 0 replies; 3+ messages in thread
From: David Bremner @ 2017-12-28 14:15 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
Tomi Ollila <tomi.ollila@iki.fi> writes:
> The appended file 'version' has the same timestamp as the files added
> by `git archive`.
pushed.
d
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-28 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 6:39 [PATCH] make release archive: common (or no) timestamps Tomi Ollila
2017-12-28 14:15 ` David Bremner
-- strict thread matches above, loose matches on Subject: below --
2017-12-11 17:31 Tomi Ollila
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).