xbps-src: always try to unmount via xbps-src-chroot-helper before exiting.

This commit is contained in:
Juan RP 2010-05-14 14:48:55 +02:00
parent 0d4d02dd91
commit a599311f15
3 changed files with 16 additions and 10 deletions

View file

@ -28,10 +28,6 @@
# Actually this needs the xbps-base-chroot package installed.
#
# Umount stuff if SIGINT or SIGQUIT was caught
trap "MASTERDIR=${XBPS_MASTERDIR} ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount && exit $?" INT QUIT
[ -n "$base_chroot" ] && return 0
if [ "${chroot_cmd}" = "chroot" ]; then
@ -277,8 +273,7 @@ xbps_chroot_handler()
action="-C $action"
env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \
${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || \
rv=$? && _umount && return $rv
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || return $?
fi
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."