File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 5
5
from pyparsing import ParseException # type: ignore
6
6
7
7
8
+ def is_in_stage2_file (ab3cfg_path : str ) -> bool :
9
+ with open (ab3cfg_path ) as f :
10
+ vars = bashvar .eval_bashvar (f .read (), filename = ab3cfg_path )
11
+ stage2_val : str = vars .get ('ABSTAGE2' )
12
+ return stage2_val == '1'
13
+ return False
14
+
15
+
16
+ def is_in_stage2_env () -> bool :
17
+ return os .environ .get ('ABSTAGE2' , '' ) == '1'
18
+
19
+
8
20
def is_in_stage2 () -> bool :
21
+ """
22
+ Return whether the current environment is in a stage2 development phase.
23
+ """
9
24
ab3cfg_path : str = os .path .join (AUTOBUILD_CONF_DIR , 'ab3cfg.sh' )
10
25
try :
11
- with open (ab3cfg_path ) as f :
12
- vars = bashvar .eval_bashvar (f .read (), filename = ab3cfg_path )
13
- stage2_val : str = vars .get ('ABSTAGE2' )
14
- return stage2_val == '1'
26
+ return is_in_stage2_env () or is_in_stage2_file (ab3cfg_path )
15
27
except OSError as e :
16
28
raise RuntimeError (f'Unable to read Autobuild config file { ab3cfg_path } .' ) from e
17
29
except ParseException as e :
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ def build(self) -> None:
94
94
build_timings : List [Tuple [str , float ]] = []
95
95
acbs .fetch .generate_mode = self .generate
96
96
acbs .parser .generate_mode = self .generate
97
+ if self .stage2 :
98
+ logging .info ("Life-cycle: currently running in stage2 mode." )
97
99
# begin finding and resolving dependencies
98
100
logging .info ('Searching and resolving dependencies...' )
99
101
acbs .pm .reorder_mode = self .reorder
You can’t perform that action at this time.
0 commit comments