GNU bug report logs - #32342
[PATCH] Do not store mtime when compressing stdin

Previous Next

Package: gzip;

Reported by: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>

Date: Wed, 1 Aug 2018 11:53:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#32342: closed ([PATCH] Do not store mtime when compressing stdin)
Date: Thu, 02 Aug 2018 17:50:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 2 Aug 2018 10:49:28 -0700
with message-id <5e745d6e-2d60-d84d-b0fb-f6c6671ba028 <at> cs.ucla.edu>
and subject line Re: bug#32342: [PATCH] Allow to override time_stamp with SOURCE_DATE_EPOCH
has caused the debbugs.gnu.org bug report #32342,
regarding [PATCH] Do not store mtime when compressing stdin
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
32342: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32342
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
To: bug-gzip <at> gnu.org
Cc: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
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



[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>
Cc: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>, 32342-done <at> debbugs.gnu.org
Subject: Re: bug#32342: [PATCH] Allow to override time_stamp with
 SOURCE_DATE_EPOCH
Date: Thu, 2 Aug 2018 10:49:28 -0700
[Message part 4 (text/plain, inline)]
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 (text/x-patch, attachment)]

This bug report was last modified 6 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.