mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/103>
This commit is contained in:
parent
900726eaf5
commit
ccb4ece73f
1 changed files with 14 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue