From 5a4c1c4ebe69a99fde15196b6a3c8159f86f820d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 7 Jun 2015 09:59:04 +0200 Subject: [PATCH] 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. --- common/chroot-style/uchroot.sh | 6 +++--- common/chroot-style/uunshare.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/chroot-style/uchroot.sh b/common/chroot-style/uchroot.sh index 395f9a6490..c881b033d5 100755 --- a/common/chroot-style/uchroot.sh +++ b/common/chroot-style/uchroot.sh @@ -6,8 +6,7 @@ readonly MASTERDIR="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" -readonly CMD="$5" -shift 5 +shift 4 if ! command -v xbps-uchroot >/dev/null 2>&1; then exit 1 @@ -18,4 +17,5 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then exit 1 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 $@ diff --git a/common/chroot-style/uunshare.sh b/common/chroot-style/uunshare.sh index 510b9c24a7..bc722151f4 100755 --- a/common/chroot-style/uunshare.sh +++ b/common/chroot-style/uunshare.sh @@ -6,8 +6,7 @@ readonly MASTERDIR="$1" readonly DISTDIR="$2" readonly HOSTDIR="$3" readonly EXTRA_ARGS="$4" -readonly CMD="$5" -shift 5 +shift 4 if ! command -v xbps-uunshare >/dev/null 2>&1; then exit 1 @@ -18,4 +17,5 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then exit 1 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 $@