diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-12-02 20:43:20 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-12-02 20:43:20 -0500 |
commit | b4d5cad408161af5fc551c62bee5b69d424a9d17 (patch) | |
tree | c4bdced35f486236c323c27359cc52c940fecd32 /mkarchroot.in | |
parent | 68438c5cc1a43aaf7b3f93aa39b63bd1877e542b (diff) |
mkarchroot: fix bug where a umount error would abort all umounts
Diffstat (limited to 'mkarchroot.in')
-rw-r--r-- | mkarchroot.in | 10 |
1 files changed, 8 insertions, 2 deletions
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 () { |