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: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
Subject: bug#32342: closed (Re: bug#32342: [PATCH] Allow to override
 time_stamp with SOURCE_DATE_EPOCH)
Date: Thu, 02 Aug 2018 17:50:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#32342: [PATCH] Do not store mtime when compressing stdin

which was filed against the gzip package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 32342 <at> debbugs.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: 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 3 (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)]
[Message part 5 (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




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

Previous Next


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