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

Re: gzip options for Packages.gz files

Please consider the attached patch against filewriter.py that restores
the old gzip compression behavior (-9n).

The -9 increases the wall time by about 12-15% on my machine; if
that's unacceptable I can live without that.  But the -n is critical.

Thanks for your consideration.

Eric Cooper             e c c @ c m u . e d u
>From 3dfb9a42b86edb99a1c656fd6cd771b57a3b8f34 Mon Sep 17 00:00:00 2001
From: Eric Cooper <ecc@cmu.edu>
Date: Thu, 12 May 2011 20:07:01 -0400
Subject: [PATCH] don't include filename or timestamp in gzipped files

(optional: also compress at level 9)

Omitting the timestamp makes it possible to reconstruct an exact copy of the .gz
file given only the uncompressed contents.  The approx caching proxy relies on this
to apply pdiffs and generate compressed index files that correctly match their checksums.

Signed-off-by: Eric Cooper <ecc@cmu.edu>
 daklib/filewriter.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daklib/filewriter.py b/daklib/filewriter.py
index 8907fa6..4958c10 100755
--- a/daklib/filewriter.py
+++ b/daklib/filewriter.py
@@ -74,7 +74,7 @@ class BaseFileWriter(object):
         if self.gzip:
-            check_call('gzip --rsyncable <%s.new >%s.gz.new' % (self.path, self.path),
+            check_call('gzip -9cn --rsyncable <%s.new >%s.gz.new' % (self.path, self.path),
                 shell = True)
             self.rename('%s.gz' % self.path)
         if self.bzip2:

Reply to: