2015-04-09 18:57:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This chroot script uses xbps-uchroot(8).
|
|
|
|
#
|
2015-12-12 10:03:41 +01:00
|
|
|
if [ -n "$XBPS_TEMP_MASTERDIR" ]; then
|
|
|
|
ARGS="-O"
|
|
|
|
fi
|
2015-04-09 18:57:41 +02:00
|
|
|
readonly MASTERDIR="$1"
|
|
|
|
readonly DISTDIR="$2"
|
|
|
|
readonly HOSTDIR="$3"
|
2015-12-12 10:03:41 +01:00
|
|
|
readonly EXTRA_ARGS="$ARGS $4"
|
2015-06-07 10:52:48 +02:00
|
|
|
readonly CMD="$5"
|
|
|
|
shift 5
|
2015-04-09 18:57:41 +02:00
|
|
|
|
|
|
|
if ! command -v xbps-uchroot >/dev/null 2>&1; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-04-09 19:30:28 +02:00
|
|
|
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
|
|
|
echo "$0 MASTERDIR/DISTDIR not set"
|
2015-04-09 18:57:41 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-06-07 10:52:48 +02:00
|
|
|
exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $CMD -- $@
|