From ccb4ece73f5e101a688e7901e55a4bf06dfb5267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 17 Jul 2020 11:51:36 +0100 Subject: [PATCH] scripts: release: Filter out duplicate js search assets for devhelp dir Don't really need this for the devhelp pages. Reduces tarball size by ~30%. Fixes #61 Part-of: --- scripts/release.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/release.py b/scripts/release.py index e70fdc868b..a9d9c656d7 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -134,8 +134,21 @@ if __name__ == "__main__": sys.exit(1) print("Generating %s" % os.path.realpath(os.path.join(os.path.curdir, outname)), file=sys.stderr) + + # Filter out duplicate js search assets for devhelp dir + def exclude_filter(tarinfo): + if '/devhelp/books/GStreamer/' in tarinfo.name: + if '/assets/fonts' in tarinfo.name: + return None + if '/assets/js/search' in tarinfo.name: + return None + if '/dumped.trie' in tarinfo.name: + return None + + return tarinfo + tar = tarfile.open(outname, 'w:xz') - tar.add(files, release_name) + tar.add(files, release_name, filter=exclude_filter) os.chdir(os.path.dirname(readme)) tar.add(os.path.basename(readme), os.path.join(release_name, os.path.basename(readme))) tar.close()