xbps-src: only umount bind mounts in the chroot shell fragment.

This commit is contained in:
Juan RP 2011-02-11 14:19:34 +01:00
parent 97ed70429b
commit 85543cd319
2 changed files with 8 additions and 27 deletions

View file

@ -1,5 +1,5 @@
#-
# Copyright (c) 2008-2010 Juan Romero Pardines.
# Copyright (c) 2008-2011 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -27,8 +27,7 @@
# Script to install packages into a sandbox in masterdir.
# Actually this needs the xbps-base-chroot package installed.
#
trap "echo && chroot_handler_interrupted $?" INT QUIT TERM
trap "_umount && return $?" 0 INT QUIT TERM
[ -n "$base_chroot" ] && return 0
@ -230,14 +229,11 @@ _mount()
return $?
}
chroot_handler_interrupted()
_umount()
{
local rv="$1"
if [ -f ${XBPS_MASTERDIR}/.xbps_chroot_working ]; then
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
fi
return $rv
MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
return $?
}
xbps_chroot_handler()
@ -274,8 +270,6 @@ xbps_chroot_handler()
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
2>&1 >/dev/null || return $?
touch -f ${XBPS_MASTERDIR}/.xbps_chroot_working
if [ "$action" = "chroot" ]; then
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || \
@ -289,7 +283,6 @@ xbps_chroot_handler()
rv=$?
fi
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR.\n"
return $rv