gstreamer/scripts/release.py
Thibault Saunier 9aa7705c95 scripts: Rework the release tarball layout
Adding everything to a `GStreamer-doc-%(project_version)` folder.
Printing release output directory

Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/issues/35

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/92>
2020-05-28 21:21:04 -04:00

18 lines
No EOL
528 B
Python

#!/usr/bin/env python3
import os
import sys
import tarfile
if __name__ == "__main__":
files = sys.argv[1]
release_name = sys.argv[2]
readme = sys.argv[3]
outname = release_name + '.tar.xz'
print("Generating %s" % os.path.realpath(os.path.join(os.path.curdir, outname)), file=sys.stderr)
tar = tarfile.open(outname, 'w:xz')
tar.add(files, release_name)
os.chdir(os.path.dirname(readme))
tar.add(os.path.basename(readme), os.path.join(release_name, os.path.basename(readme)))
tar.close()