xbps-src: do not umount if <masterdir>/.xbps_chroot_working is there.

This commit is contained in:
Juan RP 2010-05-15 17:28:18 +02:00
parent bf108c4daf
commit ab3193c208
2 changed files with 14 additions and 8 deletions

View file

@ -60,7 +60,8 @@ mount_chroot_fs()
echo 1 > ${XBPS_MASTERDIR}/.${f}_mount_bind_done
echo "done."
else
echo "failed."
echo "FAILED!!!!!"
exit 1
fi
else
cnt=$(cat ${XBPS_MASTERDIR}/.${f}_mount_bind_done)
@ -74,6 +75,10 @@ umount_chroot_fs()
{
local fs dir cnt
if [ -f ${XBPS_MASTERDIR}/.xbps_chroot_working ]; then
return 0
fi
for fs in ${REQFS}; do
[ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ] && continue
cnt=$(cat ${XBPS_MASTERDIR}/.${fs}_mount_bind_done)
@ -88,7 +93,7 @@ umount_chroot_fs()
rm -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done
echo "done."
else
echo "failed."
echo "FAILED!!!"
fi
fi
unset fs

View file

@ -224,9 +224,7 @@ _mount()
xbps_chroot_handler()
{
local action="$1"
local pkg="$2"
local norm_builddir="$3"
local action="$1" pkg="$2" norm_builddir="$3" rv=0
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
[ -z "$action" -o -z "$pkg" ] && return 1
@ -258,18 +256,21 @@ 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 || return $?
${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" || return $?
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || rv=$?
fi
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
return $?
return $rv
}