2012-04-12 19:14:11 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import gitscraper
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|