Improve install script rechecking

Rechecking the install script no longer re-prepares the user chroot.
This commit is contained in:
Stephen Seo 2024-04-02 13:30:26 +09:00
parent 487b9632aa
commit ad793a1a21

View file

@ -1876,6 +1876,7 @@ def check_install_script(
other_state: dict[str, Any], other_state: dict[str, Any],
pkg: str, pkg: str,
editor: str, editor: str,
skip_prepare_chroot=False,
): ):
"""Returns "error", "does_not_exist", and "ok".""" """Returns "error", "does_not_exist", and "ok"."""
@ -1893,7 +1894,7 @@ def check_install_script(
chroot_check_pkgbuild_path = os.path.join(chroot_build_path, "PKGBUILD") chroot_check_pkgbuild_path = os.path.join(chroot_build_path, "PKGBUILD")
chroot_check_sh_path = os.path.join(chroot_build_path, "install_check.sh") chroot_check_sh_path = os.path.join(chroot_build_path, "install_check.sh")
if not prepare_user_chroot(other_state): if not skip_prepare_chroot and not prepare_user_chroot(other_state):
log_print( log_print(
f"ERROR: Failed to prepare user chroot with dummy PKGBUILD!", f"ERROR: Failed to prepare user chroot with dummy PKGBUILD!",
other_state=other_state, other_state=other_state,
@ -2516,7 +2517,11 @@ def main():
if recheck_install_script: if recheck_install_script:
recheck_install_script = False recheck_install_script = False
check_install_script( check_install_script(
pkg_state, other_state, pkg_list[i], editor pkg_state,
other_state,
pkg_list[i],
editor,
skip_prepare_chroot=True,
) )
log_print( log_print(
"install script ok? [Y/n/r(echeck)/a(bort)/f(orce build)/b(ack)]", "install script ok? [Y/n/r(echeck)/a(bort)/f(orce build)/b(ack)]",