This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathcheck_all.py
executable file
·68 lines (47 loc) · 1.61 KB
/
check_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import subprocess
def verify(version):
global workdir
# Checkout proper dash tag
os.chdir('dash')
ignore_dir = ['.git', '.github', 'dash', 'gitian-builder', 'archive', 'gitian-keys']
for d in ignore_dir:
if d in version:
return
suffices = ['-linux', '-osx-unsigned', '-win-unsigned', '-win-signed', '-osx-signed']
tag = version
for s in suffices:
if not s in tag: continue
tag = 'v' + tag.replace(s, '')
print('tag', tag)
result = subprocess.call(['git', 'checkout', tag])
assert result == 0
os.chdir('../gitian-builder')
print('\nVerifying v' + version + '\n')
gitian_yml = ''
if 'linux' in version:
gitian_yml = "gitian-linux.yml"
elif 'win-unsigned' in version:
gitian_yml = "gitian-win.yml"
elif 'osx-unsigned' in version:
gitian_yml = "gitian-osx.yml"
elif 'win-signed' in version:
gitian_yml = 'gitian-win-signer.yml'
elif 'osx-signed' in version:
gitian_yml = 'gitian-osx-signer.yml'
else:
assert False
result = subprocess.call(
['bin/gverify', '-v', '-d', '../', '-r', version, '../dash/contrib/gitian-descriptors/' + gitian_yml])
assert result == 0
def main():
list_subfolders_with_paths = [f.path for f in os.scandir(os.getcwd()) if f.is_dir()]
versions = [x.split("/") for x in list_subfolders_with_paths]
for version in versions:
version.reverse()
versions = [x[0] for x in versions]
for version in versions:
verify(version)
os.chdir('../')
if __name__ == '__main__':
main()