xbps-src: -t requires XBPS_CHROOT_CMD=uchroot and xbps>=0.45.

This commit is contained in:
Juan RP 2015-04-16 11:35:58 +02:00
parent df690a7f22
commit f09798e802

View file

@ -216,22 +216,6 @@ check_config_vars() {
fi
}
create_temporary_masterdir() {
if [ -n "$IN_CHROOT" -o -z "$XBPS_TEMP_MASTERDIR" ]; then
return
fi
XBPS_TEMP_MASTERDIR=$(mktemp -d -q -p $XBPS_DISTDIR masterdir.XXXXXXXXX || exit 1)
cp -a $XBPS_MASTERDIR/* $XBPS_TEMP_MASTERDIR/
if [ $? -ne 0 ]; then
echo "ERROR: failed to setup temporary masterdir $XBPS_TEMP_MASTERDIR!"
exit 1
fi
export CHROOT_READY=1
export XBPS_MASTERDIR=$XBPS_TEMP_MASTERDIR
}
check_build_requirements() {
local found
@ -525,6 +509,15 @@ for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
unset val
done
# A temporary masterdir requires xbps-uchroot(8) and -O to use overlayfs
# on tmpfs (available with xbps-0.45).
if [ -n "$XBPS_TEMP_MASTERDIR" ]; then
if [ "$XBPS_CHROOT_CMD" != "uchroot" ]; then
echo "ERROR: -t requires XBPS_CHROOT_CMD=uchroot, exiting..."
exit 1
fi
export XBPS_CHROOT_CMD_ARGS="-O"
fi
#
# Sanitize PATH.
#
@ -618,10 +611,6 @@ case "$XBPS_TARGET" in
;;
fetch|extract|build|configure|install|pkg)
read_pkg
if [ -n "$XBPS_TEMP_MASTERDIR" ]; then
bootstrap_update
create_temporary_masterdir
fi
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG
else