summaryrefslogtreecommitdiff
path: root/utils/common/tarball-rbutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/common/tarball-rbutil.py')
-rwxr-xr-xutils/common/tarball-rbutil.py85
1 files changed, 85 insertions, 0 deletions
diff --git a/utils/common/tarball-rbutil.py b/utils/common/tarball-rbutil.py
new file mode 100755
index 0000000000..ccc413ca59
--- /dev/null
+++ b/utils/common/tarball-rbutil.py
@@ -0,0 +1,85 @@
1#!/usr/bin/python3
2# __________ __ ___.
3# Open \______ \ ____ ____ | | _\_ |__ _______ ___
4# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7# \/ \/ \/ \/ \/
8#
9# Copyright (c) 2022 Dominik Riebeling
10#
11# All files in this archive are subject to the GNU General Public License.
12# See the file COPYING in the source tree root for full license agreement.
13#
14# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15# KIND, either express or implied.
16#
17
18import os
19import sys
20import gitscraper
21
22if len(sys.argv) < 2:
23 print("Usage: %s <version|hash>" % sys.argv[0])
24 sys.exit()
25
26repository = os.path.abspath(
27 os.path.join(os.path.dirname(os.path.abspath(__file__)), "../.."))
28
29if '.' in sys.argv[1]:
30 version = sys.argv[1]
31 basename = f"RockboxUtility-v{version}-src"
32 ref = f"refs/tags/rbutil_{version}"
33 refs = gitscraper.get_refs(repository)
34 if ref in refs:
35 tree = refs[ref]
36 else:
37 print("Could not find hash for version!")
38 sys.exit()
39else:
40 tree = gitscraper.parse_rev(repository, sys.argv[1])
41 basename = f"RockboxUtility-{tree}"
42
43filelist = ["utils/rbutilqt",
44 "utils/ipodpatcher",
45 "utils/sansapatcher",
46 "utils/mkamsboot",
47 "utils/chinachippatcher",
48 "utils/mks5lboot",
49 "utils/mkmpioboot",
50 "utils/mkimxboot",
51 "utils/mktccboot",
52 "utils/bspatch",
53 "utils/bzip2",
54 "utils/cmake",
55 "utils/CMakeLists.txt",
56 "tools/ucl",
57 "tools/rbspeex",
58 "utils/imxtools",
59 "utils/nwztools",
60 "utils/tomcrypt",
61 "lib/rbcodec/codecs/libspeex",
62 "docs/COPYING",
63 "docs/gpl-2.0.html",
64 "docs/logo/rockbox-clef.svg",
65 "docs/logo/rockbox-logo.svg",
66 "docs/CREDITS",
67 "tools/iriver.c",
68 "tools/Makefile",
69 "tools/mkboot.h",
70 "tools/voicefont.c",
71 "tools/VOICE_PAUSE.wav",
72 "tools/voice-corrections.txt",
73 "tools/wavtrim.h",
74 "tools/iriver.h",
75 "tools/mkboot.c",
76 "tools/telechips.c",
77 "tools/telechips.h",
78 "tools/voicefont.h",
79 "tools/wavtrim.c",
80 "tools/sapi_voice.vbs"]
81
82print(f"Getting git revision {tree}")
83gitscraper.archive_files(repository, tree, filelist, basename, archive="tbz")
84
85print(f"Created {basename}.tar.bz2.")