Re: [PATCH] supply '-n' to gzip to produce identical tarballs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fraser Tweedale <frase@xxxxxxxxxxx> writes:

> Subject: [PATCH] supply '-n' to gzip to produce identical tarballs
>
> Without the '-n' ('--no-name') argument, gzip includes timestamp in
> output which results in different files.  Important systems like FreeBSD
> ports and perhaps many others hash/checksum downloaded files to ensure
> integrity.  For projects that do not release official archives, gitweb's
> snapshot feature would be an excellent stand-in but for the fact that the
> files it produces are not identical.
> 
> Supply '-n' to gzip to exclude timestamp from output and produce idential
> output every time.
> 
> Signed-off-by: Fraser Tweedale <frase@xxxxxxxxxxx>

Very good description, except subject line should denote which
subsystem this commit affects, i.e.:

  gitweb: supply '-n' to gzip to produce identical tarballs

Hmmm... gzip in gitweb's 'snapshot' action gets data compressed from
standard input, not from filesystem.  Isn't -n / --no-name no-op then?
Just asking...

> ---
>  gitweb/gitweb.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 46186ab..2ab08da 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -186,7 +186,7 @@ our %known_snapshot_formats = (
>  		'type' => 'application/x-gzip',
>  		'suffix' => '.tar.gz',
>  		'format' => 'tar',
> -		'compressor' => ['gzip']},
> +		'compressor' => ['gzip', '-n']},

Perhaps it would be more clear to use

  +		'compressor' => ['gzip', '--no-name']},

>  
>  	'tbz2' => {
>  		'display' => 'tar.bz2',
> -- 
> 1.7.4.3
> 

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]