5a4c1c4ebe
musl stops processing options in getopt as soon as a non option is processed, and this is the POSIX way. glibc needs to set this env var to behave in POSIX mode as well.
22 lines
443 B
Bash
Executable File
22 lines
443 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This chroot script uses xbps-uchroot(8).
|
|
#
|
|
readonly MASTERDIR="$1"
|
|
readonly DISTDIR="$2"
|
|
readonly HOSTDIR="$3"
|
|
readonly EXTRA_ARGS="$4"
|
|
shift 4
|
|
|
|
if ! command -v xbps-uchroot >/dev/null 2>&1; then
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
|
echo "$0 MASTERDIR/DISTDIR not set"
|
|
exit 1
|
|
fi
|
|
|
|
export POSIXLY_CORRECT=1
|
|
exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $@
|