Made the bootstrapper respect the -s option.

This commit is contained in:
Patrick 2025-07-13 13:37:05 +02:00
parent 9abb3ba39f
commit 911c5cd674

View File

@ -36,12 +36,12 @@ def _main() -> Environment:
spp_repository = config.get('SPP_REPOSITORY', _SPP_DEFAULT_REPOSITORY) spp_repository = config.get('SPP_REPOSITORY', _SPP_DEFAULT_REPOSITORY)
spp_branch = config.get('SPP_BRANCH', _SPP_DEFAULT_BRANCH) spp_branch = config.get('SPP_BRANCH', _SPP_DEFAULT_BRANCH)
print(f'Using SCons++ root at: {spp_root}') _printinfo(f'Using SCons++ root at: {spp_root}')
if not spp_root.exists(): if not spp_root.exists():
print('SCons++ does not yet exist, downloading it.') _printinfo('SCons++ does not yet exist, downloading it.')
_install_spp() _install_spp()
spp_script = spp_root / 'SConscript' spp_script = spp_root / 'SConscript'
if not spp_script.exists(): if not spp_script.exists():
_printerr(f'SCons++ main script not found at {spp_script}!') _printerr(f'SCons++ main script not found at {spp_script}!')
@ -60,7 +60,7 @@ def _get_default_spp_root() -> Path:
elif os.name == 'nt': elif os.name == 'nt':
# just use LocalAppData, which should always be set on Windows # just use LocalAppData, which should always be set on Windows
return Path(os.environ['LocalAppData'], _SPP_FOLDER_NAME) return Path(os.environ['LocalAppData'], _SPP_FOLDER_NAME)
print(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.') _printinfo(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.')
return Path(_SPP_FOLDER_NAME) return Path(_SPP_FOLDER_NAME)
def _install_spp() -> None: def _install_spp() -> None:
@ -73,6 +73,10 @@ def _install_spp() -> None:
def _exec_checked(args: Sequence[str], **kwargs) -> None: def _exec_checked(args: Sequence[str], **kwargs) -> None:
subprocess.run(args, stdout=sys.stdout, stderr=sys.stderr, check=True, **kwargs) subprocess.run(args, stdout=sys.stdout, stderr=sys.stderr, check=True, **kwargs)
if not GetOption('silent'):
_printinfo = print
else:
def _printinfo(*args): ...
def _printerr(*args) -> None: def _printerr(*args) -> None:
print(*args, file=sys.stderr) print(*args, file=sys.stderr)