From c088d72392266934b6836ce6cd7e07071e024840 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 17 Oct 2010 00:06:12 -0500 Subject: [PATCH] script/makepkg: add chup? check to flag when chroot is ready for use --- script/makepkg | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/makepkg b/script/makepkg index e34163e..9e97e13 100755 --- a/script/makepkg +++ b/script/makepkg @@ -66,6 +66,7 @@ chprepare() { # Set up chroot mounts and runtime configuration chstartup() { [ -d "${chroot_dir}" -a -f "${chroot_dir}/COPYRIGHT" -a -d "${chroot_dir}/dev" ] || wtf "Chroot not prepared" + chup? && return 0 # Rollback if a problem occurs during startup trap "chshutdown" exit hup int term kill @@ -87,6 +88,12 @@ chstartup() { return 0 } +# Check if the chroot is probably ready for use +chup?() { + [ -d "${chroot_dir}" -a -f "${chroot_dir}/COPYRIGHT" -a -c "${chroot_dir}/dev/null" ] + return $? +} + # Unmount all chroot directories chshutdown() { # Short-circuit if nothing is mounted @@ -110,6 +117,7 @@ chdestroy() { # Evaluate a command line within the chroot cheval() { + chup? || wtf "Chroot not ready" chroot "${chroot_dir}" env -i ${chroot_env} /bin/sh -c "cd ${chroot_pkg_dir}; ${*}" return $? } -- 2.42.0