Skip to content

Commit 1cebb4e

Browse files
committed
utils/invoke_autobuild: detect if stage2 file exists
1 parent ebb0552 commit 1cebb4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

acbs/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ def invoke_autobuild(task: ACBSPackageInfo, build_dir: str, stage2: bool):
187187
env_dict.update({'PKGREL': task.rel, 'PKGVER': task.version,
188188
'PKGEPOCH': task.epoch or '0'})
189189
env_dict.update(task.exported)
190-
defines_file = 'defines.stage2' if stage2 else 'defines'
190+
defines_file = 'defines'
191+
if stage2 and os.path.exists(os.path.join(build_dir, 'autobuild', 'defines.stage2')):
192+
defines_file = 'defines.stage2'
191193
with open(os.path.join(build_dir, 'autobuild', defines_file), 'at') as f:
192194
f.write('\nPKGREL=\'{}\'\nPKGVER=\'{}\'\nif [ -f \'{}\' ];then source \'{}\' && abinfo "Injected ACBS definitions";fi\n'.format(
193195
task.rel, task.version, acbs_helper, acbs_helper))

0 commit comments

Comments
 (0)