--- Begin Message ---
Subject: |
[PATCH] Do not store mtime when compressing stdin |
Date: |
Wed, 1 Aug 2018 13:51:40 +0200 |
This allows for reproducible output of
echo foo | gzip | md5sum
tar -cz -H ustar SOMEFILE | md5sum
See https://reproducible-builds.org/ for why this is good.
---
gzip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gzip.c b/gzip.c
index a023d81..4b00e42 100644
--- a/gzip.c
+++ b/gzip.c
@@ -767,7 +767,7 @@ local void treat_stdin()
{
if (S_ISREG (istat.st_mode))
time_stamp = get_stat_mtime (&istat);
- else
+ else if (decompress)
gettime (&time_stamp);
}
--
2.16.4
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#32342: [PATCH] Allow to override time_stamp with SOURCE_DATE_EPOCH |
Date: |
Thu, 2 Aug 2018 10:49:28 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/02/2018 09:12 AM, Jim Meyering wrote:
I had the same initial negative reaction to adding support for an
envvar, but given the minor effect and worthy goal, I think the
balance has tipped in favor of allowing this one.
Yes, on further thought I'm inclined to go whole hog and just fix the
durn thing without any fancy environment variables. In hindsight, that
timestamp never should have been put in there when stdin is a pipe. I
installed the attached patch, which should fix the problem. What do you
think? Although this is not strictly backward-compatible and arguably
violates the GNU coding guidelines, I can't imagine anybody really wants
that timestamp in there (except perhaps for spy agencies trying to track
what people are doing :-).
0001-gzip-make-the-output-more-reproducible.patch
Description: Text Data
--- End Message ---