2012-04-12 19:14:11 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
2019-11-17 10:55:46 +00:00
|
|
|
import gitscraper
|
2012-04-12 19:14:11 +00:00
|
|
|
|
|
|
|
if len(sys.argv) < 2:
|
2012-04-22 19:32:35 +00:00
|
|
|
print("Usage: %s <version|hash>" % sys.argv[0])
|
2012-04-12 19:14:11 +00:00
|
|
|
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:
|
2012-04-22 19:32:35 +00:00
|
|
|
print("Could not find hash for version!")
|
2012-04-12 19:14:11 +00:00
|
|
|
sys.exit()
|
|
|
|
else:
|
|
|
|
tree = sys.argv[1]
|
|
|
|
basename = "rockbox-" + tree
|
|
|
|
|
|
|
|
gitscraper.archive_files(repository, tree, [], basename, archive="7z")
|
|
|
|
|
2012-04-22 19:32:35 +00:00
|
|
|
print("done.")
|
2012-04-12 19:14:11 +00:00
|
|
|
|
|
|
|
|