From 6b5ca3429adcbf64b9af53425cbd52fccfe2e842 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sun, 17 Oct 2010 00:39:28 -0500 Subject: [PATCH] script/makepkg: rollback if a problem occurs during chstartup --- script/makepkg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/makepkg b/script/makepkg index 481c200..a4bad4c 100755 --- a/script/makepkg +++ b/script/makepkg @@ -63,6 +63,9 @@ chprepare() { chstartup() { [ -d "${chroot_dir}" -a -f "${chroot_dir}/COPYRIGHT" -a -d "${chroot_dir}/dev" ] || wtf "Chroot not prepared" + # Rollback if a problem occurs during startup + trap "chshutdown" exit hup int term kill + meh "Starting up chroot" # Necessary mountpoints @@ -74,6 +77,7 @@ chstartup() { # Chroot configuration cp -f /etc/resolv.conf "${chroot_dir}/etc/resolv.conf" || wtf "seeding /etc/resolv.conf failed" + trap "" exit hup int term kill meh "Chroot up and running in ${chroot_dir}" return 0 -- 2.42.0