diff --git a/tools/pkgchroot.sh b/tools/pkgchroot.sh index 55ae3c2fc0..3a7cffd5e2 100755 --- a/tools/pkgchroot.sh +++ b/tools/pkgchroot.sh @@ -64,7 +64,6 @@ sandbox_mount() mount -t null "$TOP/pkgsrc" "$MNT/pkgsrc" mount | grep -q " on $MNT/distfiles " || mount -t null "${DISTFILES:-$TOP/distfiles}" "$MNT/distfiles" - trap 'umount_all' EXIT INT TERM HUP mount | grep -q " on $MNT/work " || mount -t null "$SB/work" "$MNT/work" # the binary packages go where the cross build puts them, so tools/make_repo @@ -144,6 +143,7 @@ mount) sandbox_mount; echo "pkgchroot: mounted" ;; build) shift sandbox_mount + trap 'umount_all' EXIT INT TERM HUP for p in "$@"; do echo "=== pkgchroot: $p" sandbox_run "$p" install @@ -158,9 +158,11 @@ force) # Settings change went into no build at all) shift sandbox_mount + trap 'umount_all' EXIT INT TERM HUP for p in "$@"; do echo "=== pkgchroot (force): $p" sandbox_run "$p" clean + sandbox_run "$p" deinstall || true sandbox_run "$p" reinstall done sandbox_clean