common/chroot-style/proot.sh: return proper exitcode from child process
This commit is contained in:
parent
240bdb088a
commit
7de06ae844
1 changed files with 10 additions and 2 deletions
|
@ -17,6 +17,14 @@ if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exec proot -r $MASTERDIR -w / -b $DISTDIR:/void-packages \
|
||||
# proot does not properly return the resultcode. Workaround this
|
||||
RESULT=$(mktemp result.XXXXXXXXXX)
|
||||
|
||||
proot -r $MASTERDIR -w / -b "$RESULT:/.result" -b $DISTDIR:/void-packages \
|
||||
${HOSTDIR:+-b $HOSTDIR:/host} -b /proc:/proc -b /dev:/dev \
|
||||
-b /sys:/sys $EXTRA_ARGS $@
|
||||
-b /sys:/sys $EXTRA_ARGS /bin/sh -c '$@; echo $? > /.result' $0 $@
|
||||
|
||||
rv=$(cat "$RESULT")
|
||||
rm "$RESULT"
|
||||
|
||||
exit $rv
|
||||
|
|
Loading…
Reference in a new issue