From b4d5cad408161af5fc551c62bee5b69d424a9d17 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Dec 2012 20:43:20 -0500 Subject: mkarchroot: fix bug where a umount error would abort all umounts --- mkarchroot.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mkarchroot.in') diff --git a/mkarchroot.in b/mkarchroot.in index 6dd8003..7473a01 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -162,9 +162,12 @@ copy_hostconf () { sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${cache_dirs[@]})|g" -i ${working_dir}/etc/pacman.conf } +trap_unmount_err () { + error "Error unmounting" +} + trap_chroot_umount () { - trap 'trap_abort' INT QUIT TERM HUP - trap 'trap_exit' EXIT + trap 'trap_unmount_err' INT QUIT TERM HUP EXIT for cache_dir in ${cache_dirs[@]}; do umount "${working_dir}/${cache_dir}" @@ -183,6 +186,9 @@ trap_chroot_umount () { umount "${working_dir}/dev" umount "${working_dir}/run" fi + + trap 'trap_abort' INT QUIT TERM HUP + trap 'trap_exit' EXIT } chroot_lock () { -- cgit v1.2.3-70-g09d2