rockbox/utils/common/tarball.py
Dominik Riebeling 440791105a deploy: Fix various style issues.
Fix various pylint issues and some python3 compatibility.

Change-Id: I2c35ccc5ad2d0902c229f9de57912cf6d5a83ece
2020-06-13 20:11:48 +02:00

30 lines
682 B
Python
Executable file

#!/usr/bin/python
import os
import sys
import gitscraper
if len(sys.argv) < 2:
print("Usage: %s <version|hash>" % sys.argv[0])
sys.exit()
repository = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../..")
if '.' in sys.argv[1]:
version = sys.argv[1]
basename = "rockbox-" + version
ref = "refs/tags/v" + version + "-final"
refs = gitscraper.get_refs(repository)
if ref in refs:
tree = refs[ref]
else:
print("Could not find hash for version!")
sys.exit()
else:
tree = sys.argv[1]
basename = "rockbox-" + tree
gitscraper.archive_files(repository, tree, [], basename, archive="7z")
print("done.")