xbps-src: improve multiple mount/umount chroot handling.
This commit is contained in:
parent
4f8c08b27e
commit
9e285b9608
1 changed files with 16 additions and 2 deletions
|
@ -28,6 +28,8 @@
|
|||
# Actually this needs the xbps-base-chroot package installed.
|
||||
#
|
||||
|
||||
trap "echo && chroot_handler_interrupted $?" INT QUIT TERM KILL
|
||||
|
||||
[ -n "$base_chroot" ] && return 0
|
||||
|
||||
if [ "${chroot_cmd}" = "chroot" ]; then
|
||||
|
@ -222,6 +224,16 @@ _mount()
|
|||
return $?
|
||||
}
|
||||
|
||||
chroot_handler_interrupted()
|
||||
{
|
||||
local rv="$1"
|
||||
|
||||
if [ -f ${XBPS_MASTERDIR}/.xbps_chroot_working ]; then
|
||||
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
|
||||
fi
|
||||
return $rv
|
||||
}
|
||||
|
||||
xbps_chroot_handler()
|
||||
{
|
||||
local action="$1" pkg="$2" norm_builddir="$3" rv=0
|
||||
|
@ -260,13 +272,15 @@ xbps_chroot_handler()
|
|||
|
||||
if [ "$action" = "chroot" ]; then
|
||||
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
|
||||
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$?
|
||||
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || \
|
||||
rv=$?
|
||||
else
|
||||
[ "$norm_builddir" = "yes" ] && \
|
||||
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=$?
|
||||
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || \
|
||||
rv=$?
|
||||
fi
|
||||
|
||||
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue