xbps-src: unbreak chroot-style scripts.

This commit is contained in:
Juan RP 2015-04-09 19:30:28 +02:00
parent c7f21fd595
commit ed6345f938
3 changed files with 12 additions and 18 deletions

View file

@ -6,19 +6,17 @@ readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly COMMAND="$5"
shift 5
readonly COMMAND_ARGS="$@"
shift 4
if ! command -v proot >/dev/null 2>&1; then
exit 1
fi
if [ -z "$MASTERDIR" -o -z "$DISTDIR" -o -z "$COMMAND" ]; then
echo "$0 MASTERDIR/DISTDIR/COMMAND not set"
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
exec proot -r $XBPS_MASTERDIR -w / -b $DISTDIR:/void-packages \
${HOSTDIR:+-b $HOSTDIR:/host} -b /proc:/proc -b /dev:/dev \
-b /sys:/sys $EXTRA_ARGS $COMMAND $COMMAND_ARGS
-b /sys:/sys $EXTRA_ARGS $@

View file

@ -6,17 +6,15 @@ readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly COMMAND="$5"
shift 5
readonly COMMAND_ARGS="$@"
shift 4
if ! command -v xbps-uchroot >/dev/null 2>&1; then
exit 1
fi
if [ -z "$MASTERDIR" -o -z "$DISTDIR" -o -z "$COMMAND" ]; then
echo "$0 MASTERDIR/DISTDIR/COMMAND not set"
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
exec xbps-uchroot $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $XBPS_MASTERDIR $COMMAND $COMMAND_ARGS
exec xbps-uchroot $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $MASTERDIR $@

View file

@ -6,17 +6,15 @@ readonly MASTERDIR="$1"
readonly DISTDIR="$2"
readonly HOSTDIR="$3"
readonly EXTRA_ARGS="$4"
readonly COMMAND="$5"
shift 5
readonly COMMAND_ARGS="$@"
shift 4
if ! command -v xbps-uunshare >/dev/null 2>&1; then
exit 1
fi
if [ -z "$MASTERDIR" -o -z "$DISTDIR" -o -z "$COMMAND" ]; then
echo "$0 MASTERDIR/DISTDIR/COMMAND not set"
if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
exit 1
fi
exec xbps-uunshare $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $XBPS_MASTERDIR $COMMAND $COMMAND_ARGS
exec xbps-uunshare $EXTRA_ARGS -D $DISTDIR ${HOSTDIR:+-H $HOSTDIR} $MASTERDIR $@