Commit ccb4ece7 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

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: <gstreamer/gst-docs!103>
parent 900726ea
...@@ -134,8 +134,21 @@ if __name__ == "__main__": ...@@ -134,8 +134,21 @@ if __name__ == "__main__":
sys.exit(1) sys.exit(1)
print("Generating %s" % os.path.realpath(os.path.join(os.path.curdir, outname)), file=sys.stderr) 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 = tarfile.open(outname, 'w:xz')
tar.add(files, release_name) tar.add(files, release_name, filter=exclude_filter)
os.chdir(os.path.dirname(readme)) os.chdir(os.path.dirname(readme))
tar.add(os.path.basename(readme), os.path.join(release_name, os.path.basename(readme))) tar.add(os.path.basename(readme), os.path.join(release_name, os.path.basename(readme)))
tar.close() tar.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment