diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-01-26 22:23:24 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-01-26 22:23:24 +0100 |
commit | a50275c5dd2e1647c65d385134d359932a0384f9 (patch) | |
tree | a05f45c73330099584c16073152185807a130ed9 | |
parent | 450aea660ab4f975a2164a2c2f76297c1c9adda4 (diff) | |
download | jenkins.debian.net-a50275c5dd2e1647c65d385134d359932a0384f9.tar.xz |
chroot-installation: handle failures properly
-rwxr-xr-x | bin/chroot-installation.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh index eff64ced..b1daa4e7 100755 --- a/bin/chroot-installation.sh +++ b/bin/chroot-installation.sh @@ -3,7 +3,7 @@ # Copyright 2012-2015 Holger Levsen <holger@layer-acht.org> # released under the GPLv=2 -DEBUG=false +DEBUG=true . /srv/jenkins/bin/common-functions.sh common_init "$@" @@ -38,6 +38,11 @@ cleanup_all() { sudo umount -l $CHROOT_TARGET/proc || fuser -mv $CHROOT_TARGET/proc sudo rm -rf --one-file-system $CHROOT_TARGET || fuser -mv $CHROOT_TARGET rm -f $TMPLOG + if [ "$1" = "good" ] ; then + exit 0 + else + exit 1 + fi } execute_ctmpfile() { @@ -245,6 +250,6 @@ if [ "$3" != "" ] ; then esac fi -cleanup_all trap - INT TERM EXIT +cleanup_all good |