-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·45 lines (37 loc) · 1.07 KB
/
setup.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
#!/usr/bin/env python
import os
import sys
from multiprocessing import cpu_count
from subprocess import check_call
SOURCES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'sources',
)
RESOURCES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'resources',
)
if not os.path.exists(SOURCES):
print('Creating %s..' % SOURCES)
os.makedirs(SOURCES)
for version in ['9.0', '10.0', '11.0', '12.0']:
print('Cloning repositories: %s..' % version)
REPOSITORIES = os.path.join(SOURCES, version)
if not os.path.exists(REPOSITORIES):
os.makedirs(REPOSITORIES)
if not os.path.exists(os.path.join(RESOURCES, 'repos.%s.yml' % version)):
continue
check_call(
[
'gitaggregate',
'--expand-env',
'--config',
os.path.join(RESOURCES, 'repos.%s.yml' % version),
'--jobs',
str(cpu_count() or 1),
],
cwd=REPOSITORIES,
env=dict(os.environ, ODOO_VERSION=version),
stderr=sys.stderr,
stdout=sys.stdout,
)