]> err.no Git - dak/commitdiff
don't include filename or timestamp in gzipped files
authorEric Cooper <ecc@cmu.edu>
Fri, 13 May 2011 00:07:01 +0000 (20:07 -0400)
committerJoerg Jaspert <joerg@debian.org>
Fri, 13 May 2011 07:16:33 +0000 (09:16 +0200)
(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

index 8907fa6d96fa39f7c8e2d7163f3c20e4f361bd2e..4958c10b70877b1aa9a6555baab2802939e8934e 100755 (executable)
@@ -74,7 +74,7 @@ class BaseFileWriter(object):
         '''
         self.file.close()
         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: