Skip to content

Commit 58f37b3

Browse files
committed
utils/build: inject stage2 files when in stage2 mode
1 parent 2d79404 commit 58f37b3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

acbs/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def build_sequential(self, build_timings, packages):
250250
install_from_repo(task.installables)
251251
start = time.monotonic()
252252
try:
253-
invoke_autobuild(task, build_dir)
253+
invoke_autobuild(task, build_dir, self.stage2)
254254
check_artifact(task.name, build_dir)
255255
except Exception:
256256
# early printing of build summary before exploding

acbs/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def check_artifact(name: str, build_dir: str):
176176
'STOP! Autobuild3 malfunction detected! Returned zero status with no artifact.')
177177

178178

179-
def invoke_autobuild(task: ACBSPackageInfo, build_dir: str):
179+
def invoke_autobuild(task: ACBSPackageInfo, build_dir: str, stage2: bool):
180180
dst_dir = os.path.join(build_dir, 'autobuild')
181181
if os.path.exists(dst_dir) and task.group_seq > 1:
182182
shutil.rmtree(dst_dir)
@@ -187,7 +187,8 @@ def invoke_autobuild(task: ACBSPackageInfo, build_dir: str):
187187
env_dict.update({'PKGREL': task.rel, 'PKGVER': task.version,
188188
'PKGEPOCH': task.epoch or '0'})
189189
env_dict.update(task.exported)
190-
with open(os.path.join(build_dir, 'autobuild', 'defines'), 'at') as f:
190+
defines_file = 'defines.stage2' if stage2 else 'defines'
191+
with open(os.path.join(build_dir, 'autobuild', defines_file), 'at') as f:
191192
f.write('\nPKGREL=\'{}\'\nPKGVER=\'{}\'\nif [ -f \'{}\' ];then source \'{}\' && abinfo "Injected ACBS definitions";fi\n'.format(
192193
task.rel, task.version, acbs_helper, acbs_helper))
193194
if task.epoch:

0 commit comments

Comments
 (0)