chroot-style: u{chroot,unshare}: set POSIXLY_CORRECT to behave in POSIX mode.

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.
This commit is contained in:
Juan RP 2015-06-07 09:59:04 +02:00
parent c54a87f0ea
commit 5a4c1c4ebe
2 changed files with 6 additions and 6 deletions

View file

@ -6,8 +6,7 @@ readonly MASTERDIR="$1"
readonly DISTDIR="$2" readonly DISTDIR="$2"
readonly HOSTDIR="$3" readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4" readonly EXTRA_ARGS="$4"
readonly CMD="$5" shift 4
shift 5
if ! command -v xbps-uchroot >/dev/null 2>&1; then if ! command -v xbps-uchroot >/dev/null 2>&1; then
exit 1 exit 1
@ -18,4 +17,5 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
exit 1 exit 1
fi fi
exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $CMD -- $@ export POSIXLY_CORRECT=1
exec xbps-uchroot $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $@

View file

@ -6,8 +6,7 @@ readonly MASTERDIR="$1"
readonly DISTDIR="$2" readonly DISTDIR="$2"
readonly HOSTDIR="$3" readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4" readonly EXTRA_ARGS="$4"
readonly CMD="$5" shift 4
shift 5
if ! command -v xbps-uunshare >/dev/null 2>&1; then if ! command -v xbps-uunshare >/dev/null 2>&1; then
exit 1 exit 1
@ -18,4 +17,5 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
exit 1 exit 1
fi fi
exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $CMD -- $@ export POSIXLY_CORRECT=1
exec xbps-uunshare $EXTRA_ARGS -b $DISTDIR:/void-packages ${HOSTDIR:+-b $HOSTDIR:/host} $MASTERDIR $@