From: Michael Prokop Date: Wed, 25 Oct 2023 08:04:20 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/pr/226' X-Git-Tag: v0.105~16 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=2999d61efa6841d22024fc6c5fde16dc44db8a20;hp=85cbbe05b2cd5d3707d63335ac9e0235bc312072;p=grml-debootstrap.git Merge remote-tracking branch 'origin/pr/226' --- diff --git a/chroot-script b/chroot-script index 48ce326..3c69f00 100755 --- a/chroot-script +++ b/chroot-script @@ -11,6 +11,7 @@ # error_handler {{{ if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then + set -e set -E set -o pipefail trap "error_handler" ERR diff --git a/grml-debootstrap b/grml-debootstrap index e3404d4..8994542 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -31,6 +31,7 @@ last bash command: $last_bash_command" } if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then + set -e set -E set -o pipefail trap "error_handler" ERR @@ -2177,7 +2178,8 @@ for i in format_efi_partition prepare_vm mkfs tunefs \ preparechroot execute_pre_scripts chrootscript execute_post_scripts \ remove_configs umount_chroot grub_install umount_target fscktool ; do if stage "${i}" ; then - if "$i" ; then + "$i" + if [ $? -eq 0 ]; then stage "${i}" 'done' && rm -f "${STAGES}/${i}" else bailout 2 "$i"