summaryrefslogtreecommitdiff
path: root/mkarchroot.in
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-12-02 20:43:20 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-12-02 20:43:20 -0500
commitb4d5cad408161af5fc551c62bee5b69d424a9d17 (patch)
treec4bdced35f486236c323c27359cc52c940fecd32 /mkarchroot.in
parent68438c5cc1a43aaf7b3f93aa39b63bd1877e542b (diff)
downloaddevtools32-b4d5cad408161af5fc551c62bee5b69d424a9d17.tar.xz
mkarchroot: fix bug where a umount error would abort all umounts
Diffstat (limited to 'mkarchroot.in')
-rw-r--r--mkarchroot.in10
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 () {