summaryrefslogtreecommitdiff
path: root/utils/gen_fast_manifest.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-11-25 08:51:09 +0100
committerMichał Górny <mgorny@gentoo.org>2017-11-25 09:04:02 +0100
commitcf1fa4956a3a879aecfdaf84172a7dde82da5c47 (patch)
tree89772e2a1c14caf03eccef94a46462f6ababfb01 /utils/gen_fast_manifest.py
parent6283a3ab918f78f209f1457b82efd5156b054ea5 (diff)
downloadgemato-cf1fa4956a3a879aecfdaf84172a7dde82da5c47.tar.gz
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.
Diffstat (limited to 'utils/gen_fast_manifest.py')
-rwxr-xr-xutils/gen_fast_manifest.py8
1 files changed, 2 insertions, 6 deletions
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: