From cf1fa4956a3a879aecfdaf84172a7dde82da5c47 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sat, 25 Nov 2017 08:51:09 +0100 Subject: gen_fast_*: Split top-level Manifests to save bandwidth Split the potential-top-level Manifests into separate 'Manifest.files[.gz]' and 'Manifest' with the former containing large set of (possibly unchanged) files and the latter referencing the former and containing the timestamp. --- utils/gen_fast_manifest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'utils/gen_fast_manifest.py') diff --git a/utils/gen_fast_manifest.py b/utils/gen_fast_manifest.py index 049761f..9d58e46 100755 --- a/utils/gen_fast_manifest.py +++ b/utils/gen_fast_manifest.py @@ -36,7 +36,7 @@ def generate_manifest_entries(out, topdir): for dirpath, dirs, files in os.walk(topdir): if dirpath != topdir: for f in files: - if f.startswith('Manifest'): + if f in ('Manifest', 'Manifest.gz'): fp = os.path.join(dirpath, f) out.append(get_manifest_entry('MANIFEST', fp, os.path.relpath(fp, topdir))) @@ -50,7 +50,7 @@ def generate_manifest_entries(out, topdir): continue else: # enable compat mode for ebuild directories - if any(f.endswith('.ebuild') for f in files): + if any(f.endswith('.ebuild') and f != 'skel.ebuild' for f in files): compat_mode = True # skip dot-dirs @@ -101,10 +101,6 @@ def gen_manifest(top_dir): compat_mode = generate_manifest_entries(manifest_entries, top_dir) manifest_entries.sort() - # do not compress files which we want valid top-level Manifests - if top_dir.endswith('metadata/glsa') or top_dir.endswith('metadata/news'): - compat_mode = True - 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: -- cgit v1.2.3