xbps-src: do not umount if <masterdir>/.xbps_chroot_working is there.
This commit is contained in:
parent
bf108c4daf
commit
ab3193c208
2 changed files with 14 additions and 8 deletions
|
@ -60,7 +60,8 @@ mount_chroot_fs()
|
||||||
echo 1 > ${XBPS_MASTERDIR}/.${f}_mount_bind_done
|
echo 1 > ${XBPS_MASTERDIR}/.${f}_mount_bind_done
|
||||||
echo "done."
|
echo "done."
|
||||||
else
|
else
|
||||||
echo "failed."
|
echo "FAILED!!!!!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cnt=$(cat ${XBPS_MASTERDIR}/.${f}_mount_bind_done)
|
cnt=$(cat ${XBPS_MASTERDIR}/.${f}_mount_bind_done)
|
||||||
|
@ -74,6 +75,10 @@ umount_chroot_fs()
|
||||||
{
|
{
|
||||||
local fs dir cnt
|
local fs dir cnt
|
||||||
|
|
||||||
|
if [ -f ${XBPS_MASTERDIR}/.xbps_chroot_working ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
for fs in ${REQFS}; do
|
for fs in ${REQFS}; do
|
||||||
[ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ] && continue
|
[ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ] && continue
|
||||||
cnt=$(cat ${XBPS_MASTERDIR}/.${fs}_mount_bind_done)
|
cnt=$(cat ${XBPS_MASTERDIR}/.${fs}_mount_bind_done)
|
||||||
|
@ -88,7 +93,7 @@ umount_chroot_fs()
|
||||||
rm -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done
|
rm -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done
|
||||||
echo "done."
|
echo "done."
|
||||||
else
|
else
|
||||||
echo "failed."
|
echo "FAILED!!!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset fs
|
unset fs
|
||||||
|
|
|
@ -224,9 +224,7 @@ _mount()
|
||||||
|
|
||||||
xbps_chroot_handler()
|
xbps_chroot_handler()
|
||||||
{
|
{
|
||||||
local action="$1"
|
local action="$1" pkg="$2" norm_builddir="$3" rv=0
|
||||||
local pkg="$2"
|
|
||||||
local norm_builddir="$3"
|
|
||||||
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
|
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
|
||||||
|
|
||||||
[ -z "$action" -o -z "$pkg" ] && return 1
|
[ -z "$action" -o -z "$pkg" ] && return 1
|
||||||
|
@ -258,18 +256,21 @@ xbps_chroot_handler()
|
||||||
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
|
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
|
||||||
2>&1 >/dev/null || return $?
|
2>&1 >/dev/null || return $?
|
||||||
|
|
||||||
|
touch -f ${XBPS_MASTERDIR}/.xbps_chroot_working
|
||||||
|
|
||||||
if [ "$action" = "chroot" ]; then
|
if [ "$action" = "chroot" ]; then
|
||||||
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
|
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
|
else
|
||||||
[ "$norm_builddir" = "yes" ] && \
|
[ "$norm_builddir" = "yes" ] && \
|
||||||
action="-C $action"
|
action="-C $action"
|
||||||
env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \
|
env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \
|
||||||
${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
${chroot_cmd} $XBPS_MASTERDIR sh -c \
|
||||||
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || return $?
|
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || rv=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f ${XBPS_MASTERDIR}/.xbps_chroot_working
|
||||||
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
|
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR."
|
||||||
|
|
||||||
return $?
|
return $rv
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue