diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/common/tarball.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/common/tarball.py b/utils/common/tarball.py new file mode 100755 index 0000000000..57765a55c7 --- /dev/null +++ b/utils/common/tarball.py | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/usr/bin/python | ||
2 | |||
3 | import gitscraper | ||
4 | import os | ||
5 | import sys | ||
6 | |||
7 | if len(sys.argv) < 2: | ||
8 | print "Usage: %s <version|hash>" % sys.argv[0] | ||
9 | sys.exit() | ||
10 | |||
11 | repository = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../..") | ||
12 | if '.' in sys.argv[1]: | ||
13 | version = sys.argv[1] | ||
14 | basename = "rockbox-" + version | ||
15 | ref = "refs/tags/v" + version + "-final" | ||
16 | refs = gitscraper.get_refs(repository) | ||
17 | if ref in refs: | ||
18 | tree = refs[ref] | ||
19 | else: | ||
20 | print "Could not find hash for version!" | ||
21 | sys.exit() | ||
22 | else: | ||
23 | tree = sys.argv[1] | ||
24 | basename = "rockbox-" + tree | ||
25 | |||
26 | gitscraper.archive_files(repository, tree, [], basename, archive="7z") | ||
27 | |||
28 | print "done." | ||
29 | |||
30 | |||