From f90bf1006a7d15478c538c5a97f2d9d9d711035f Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Tue, 5 Oct 2021 17:34:43 +0200 Subject: [PATCH] Fixup error shell, exception log level in main() and arch checking before docker wrapping in cmd_build() --- main.py | 9 ++++++--- packages.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index c622075..fffdf62 100755 --- a/main.py +++ b/main.py @@ -34,10 +34,13 @@ def cli(verbose: bool = False, config_file: str = None, no_wrapper: bool = False def main(): try: return cli(prog_name='kupferbootstrap') - except Exception: - logging.fatal(get_trace()) - logging.info('Starting error shell. Type exit to quit.') + except Exception as ex: + if config.runtime['verbose']: + logging.fatal(get_trace()) + else: + logging.fatal(ex) if config.runtime['error_shell']: + logging.info('Starting error shell. Type exit to quit.') subprocess.call('/bin/bash') exit(1) diff --git a/packages.py b/packages.py index 4e7507e..1274733 100644 --- a/packages.py +++ b/packages.py @@ -497,13 +497,13 @@ def cmd_packages(): @click.option('--arch', default=None) @click.argument('paths', nargs=-1) def cmd_build(paths: list[str], force=False, arch=None): - enforce_wrap() if arch is None: # arch = config.get_profile()... arch = 'aarch64' if arch not in ARCHES: raise Exception(f'Unknown architecture "{arch}". Choices: {", ".join(ARCHES)}') + enforce_wrap() for _arch in set([arch, config.runtime['arch']]): check_prebuilts(_arch)