From f573b7234110683a5ee78abfd4e375c64ccd1a8c Mon Sep 17 00:00:00 2001 From: Mingcong Bai Date: Tue, 9 Jan 2024 03:17:23 -0800 Subject: [PATCH] main: use ab4cfg.sh It is now not necessary to have Autobuild3 installed. --- acbs/{ab3cfg.py => ab4cfg.py} | 14 +++++++------- acbs/main.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) rename acbs/{ab3cfg.py => ab4cfg.py} (69%) diff --git a/acbs/ab3cfg.py b/acbs/ab4cfg.py similarity index 69% rename from acbs/ab3cfg.py rename to acbs/ab4cfg.py index 5983a37..13cd8db 100644 --- a/acbs/ab3cfg.py +++ b/acbs/ab4cfg.py @@ -5,9 +5,9 @@ from pyparsing import ParseException # type: ignore -def is_in_stage2_file(ab3cfg_path: str) -> bool: - with open(ab3cfg_path) as f: - vars = bashvar.eval_bashvar(f.read(), filename=ab3cfg_path) +def is_in_stage2_file(ab4cfg_path: str) -> bool: + with open(ab4cfg_path) as f: + vars = bashvar.eval_bashvar(f.read(), filename=ab4cfg_path) stage2_val: str = vars.get('ABSTAGE2') return stage2_val == '1' return False @@ -21,12 +21,12 @@ def is_in_stage2() -> bool: """ Return whether the current environment is in a stage2 development phase. """ - ab3cfg_path: str = os.path.join(AUTOBUILD_CONF_DIR, 'ab3cfg.sh') + ab4cfg_path: str = os.path.join(AUTOBUILD_CONF_DIR, 'ab4cfg.sh') try: - return is_in_stage2_env() or is_in_stage2_file(ab3cfg_path) + return is_in_stage2_env() or is_in_stage2_file(ab4cfg_path) except OSError as e: - raise RuntimeError(f'Unable to read Autobuild config file {ab3cfg_path}.') from e + raise RuntimeError(f'Unable to read Autobuild config file {ab4cfg_path}.') from e except ParseException as e: - raise RuntimeError(f'Error occurred while parsing Autobuild config file {ab3cfg_path}.') from e + raise RuntimeError(f'Error occurred while parsing Autobuild config file {ab4cfg_path}.') from e except Exception as e: raise RuntimeError(f'Error occurred while checking whether stage 2 mode is enabled.') from e diff --git a/acbs/main.py b/acbs/main.py index bf7c6bb..dcc05d8 100644 --- a/acbs/main.py +++ b/acbs/main.py @@ -12,7 +12,7 @@ import acbs.parser from acbs import __version__ -from acbs.ab3cfg import is_in_stage2 +from acbs.ab4cfg import is_in_stage2 from acbs.base import ACBSPackageInfo from acbs.checkpoint import ACBSShrinkWrap, do_shrink_wrap, checkpoint_to_group from acbs.const import CONF_DIR, DUMP_DIR, LOG_DIR, TMP_DIR, AUTOBUILD_CONF_DIR