6
6
from acbs .utils import make_build_dir
7
7
8
8
9
- def check_package_group (name : str , search_path : str , entry_path : str , stage2 = False ) -> Optional [List [ACBSPackageInfo ]]:
9
+ def check_package_group (name : str , search_path : str , entry_path : str , stage2 : bool ) -> Optional [List [ACBSPackageInfo ]]:
10
10
# is this a package group?
11
11
if os .path .basename (entry_path ) == os .path .basename (name ) and os .path .isfile (os .path .join (search_path , entry_path , 'spec' )):
12
12
stub = ACBSPackageInfo (name , [], '' , [ACBSSourceInfo ('none' , '' , '' )])
13
13
stub .base_slug = entry_path
14
- return expand_package_group (stub , search_path , stage2 = stage2 )
14
+ return expand_package_group (stub , search_path , stage2 )
15
15
with os .scandir (os .path .join (search_path , entry_path )) as group :
16
16
# scan potential package groups
17
17
for entry_group in group :
@@ -23,7 +23,7 @@ def check_package_group(name: str, search_path: str, entry_path: str, stage2=Fal
23
23
continue
24
24
# because the package inside the group will have a different name than the folder name
25
25
# we will parse the defines file to decide
26
- result = parse_package (full_search_path , stage2 = stage2 )
26
+ result = parse_package (full_search_path , stage2 )
27
27
if result and result .name == name :
28
28
# name of the package inside the group
29
29
package_alias = os .path .basename (
@@ -42,12 +42,12 @@ def check_package_group(name: str, search_path: str, entry_path: str, stage2=Fal
42
42
group_category ), root = os .path .basename (group_root ))
43
43
result .group_seq = group_seq
44
44
group_result = expand_package_group (
45
- result , search_path , stage2 = stage2 )
45
+ result , search_path , stage2 )
46
46
return group_result
47
47
return None
48
48
49
49
50
- def find_package (name : str , search_path : str , stage2 = False ) -> List [ACBSPackageInfo ]:
50
+ def find_package (name : str , search_path : str , stage2 : bool ) -> List [ACBSPackageInfo ]:
51
51
if os .path .isfile (os .path .join (search_path , name )):
52
52
with open (os .path .join (search_path , name ), 'rt' ) as f :
53
53
content = f .read ()
@@ -59,23 +59,23 @@ def find_package(name: str, search_path: str, stage2=False) -> List[ACBSPackageI
59
59
p = p .strip ()
60
60
if not p or p .startswith ('#' ):
61
61
continue
62
- found = find_package_inner (p , search_path , stage2 = stage2 )
62
+ found = find_package_inner (p , search_path , stage2 )
63
63
if not found :
64
64
raise RuntimeError (
65
65
f'Package { p } requested in { name } was not found.' )
66
66
results .extend (found )
67
67
print ()
68
68
return results
69
- return find_package_inner (name , search_path , stage2 = stage2 )
69
+ return find_package_inner (name , search_path , stage2 )
70
70
71
71
72
- def find_package_inner (name : str , search_path : str , group = False , stage2 = False ) -> List [ACBSPackageInfo ]:
72
+ def find_package_inner (name : str , search_path : str , stage2 : bool , group = False ) -> List [ACBSPackageInfo ]:
73
73
if os .path .isdir (os .path .join (search_path , name )):
74
74
flat_path = os .path .join (search_path , name , 'autobuild' )
75
75
if os .path .isdir (flat_path ):
76
- return [parse_package (os .path .join (search_path , name , 'autobuild' ), stage2 = stage2 )]
76
+ return [parse_package (os .path .join (search_path , name , 'autobuild' ), stage2 )]
77
77
# is this a package group?
78
- group_result = check_package_group (name , search_path , name , stage2 = stage2 )
78
+ group_result = check_package_group (name , search_path , name , stage2 )
79
79
if group_result :
80
80
return group_result
81
81
with os .scandir (search_path ) as it :
@@ -91,12 +91,12 @@ def find_package_inner(name: str, search_path: str, group=False, stage2=False) -
91
91
full_search_path = os .path .join (
92
92
search_path , entry .name , entry_inner .name , 'autobuild' )
93
93
if entry_inner .name == name and os .path .isdir (full_search_path ):
94
- return [parse_package (full_search_path , stage2 = stage2 )]
94
+ return [parse_package (full_search_path , stage2 )]
95
95
if not group :
96
96
continue
97
97
# is this a package group?
98
98
group_result = check_package_group (
99
- name , search_path , os .path .join (entry .name , entry_inner .name ), stage2 = stage2 )
99
+ name , search_path , os .path .join (entry .name , entry_inner .name ), stage2 )
100
100
if group_result :
101
101
return group_result
102
102
if group :
@@ -124,7 +124,7 @@ def check_package_groups(packages: List[ACBSPackageInfo]):
124
124
groups_seen [base_slug ] = pkg .group_seq
125
125
126
126
127
- def expand_package_group (package : ACBSPackageInfo , search_path : str , stage2 = False ) -> List [ACBSPackageInfo ]:
127
+ def expand_package_group (package : ACBSPackageInfo , search_path : str , stage2 : bool ) -> List [ACBSPackageInfo ]:
128
128
group_root = os .path .join (search_path , package .base_slug )
129
129
original_base = package .base_slug
130
130
actionables : List [ACBSPackageInfo ] = []
@@ -138,7 +138,7 @@ def expand_package_group(package: ACBSPackageInfo, search_path: str, stage2=Fals
138
138
'Malformed sub-package name: {name}' .format (name = entry .name ))
139
139
try :
140
140
sequence = int (splitted [0 ])
141
- package = parse_package (entry .path , stage2 = stage2 )
141
+ package = parse_package (entry .path , stage2 )
142
142
if package :
143
143
package .base_slug = original_base
144
144
package .group_seq = sequence
0 commit comments