diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-25 11:44:11 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-11-25 11:44:11 +0100 |
commit | 279658d0e729a1a5781205069ac5d25f29af959d (patch) | |
tree | 9d5910fc3dd91e2f845495f7cf9d2f609859fb69 | |
parent | b47d4686b3274a52abd8c5251a5756e7693a62f5 (diff) | |
download | gemato-279658d0e729a1a5781205069ac5d25f29af959d.tar.gz |
compression: Do not store filename in gzip files
It has no value for us and just wastes space.
-rw-r--r-- | gemato/compression.py | 4 | ||||
-rwxr-xr-x | utils/gen_fast_manifest.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gemato/compression.py b/gemato/compression.py index cb3fa5a..11ede67 100644 --- a/gemato/compression.py +++ b/gemato/compression.py @@ -50,9 +50,9 @@ def open_compressed_file(suffix, f, mode='rb'): def read1(self, *args, **kwargs): return self.read(*args, **kwargs) - return FixedGzipFile(fileobj=f, mode=mode, mtime=0) + return FixedGzipFile(fileobj=f, mode=mode, filename='', mtime=0) - return gzip.GzipFile(fileobj=f, mode=mode, mtime=0) + return gzip.GzipFile(fileobj=f, mode=mode, filename='', mtime=0) elif suffix == "bz2" and bz2 is not None: return bz2.BZ2File(f, mode=mode) elif suffix == "lzma" and lzma is not None: diff --git a/utils/gen_fast_manifest.py b/utils/gen_fast_manifest.py index 9d58e46..8e4b244 100755 --- a/utils/gen_fast_manifest.py +++ b/utils/gen_fast_manifest.py @@ -103,7 +103,8 @@ def gen_manifest(top_dir): manifest_data = b'\n'.join(manifest_entries) + b'\n' if len(manifest_data) > 4096 and not compat_mode: - with gzip.GzipFile(os.path.join(top_dir, 'Manifest.gz'), 'wb', mtime=0) as f: + with gzip.GzipFile(os.path.join(top_dir, 'Manifest.gz'), 'wb', + filename='', mtime=0) as f: f.write(manifest_data) if had_manifest: os.unlink(os.path.join(top_dir, 'Manifest')) |