forked from yan12125/python3-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (32 loc) · 1.02 KB
/
Copy pathmain.py
File metadata and controls
52 lines (32 loc) · 1.02 KB
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
import logging
from .package import import_package
built_packags: set = set()
logger = logging.getLogger(__name__)
def build_package(pkgname: str) -> None:
if pkgname in built_packags:
return
pkg = import_package(pkgname)
need_prepare = False
logger.info(f'Building {pkgname} {pkg.get_version()}')
if pkg.need_download():
for src in pkg.sources:
src.download()
# All signatures should be downloaded first so that sources can be verified
for src in pkg.sources:
src.verify()
src.extract()
for patch in getattr(pkg, 'patches', []):
patch.apply(pkg.source)
need_prepare = True
for dep in pkg.dependencies:
build_package(dep)
if need_prepare:
try:
pkg.prepare()
except NotImplementedError:
print('Skipping prepare step')
pkg.build()
built_packags.add(pkgname)
def main():
logging.basicConfig(level=logging.DEBUG)
build_package('python')