common: fix exit status of uname wrapper

This commit is contained in:
Đoàn Trần Công Danh 2021-01-25 08:56:55 +07:00
parent ae14915b51
commit c1fa95a097

View file

@ -1,11 +1,11 @@
#!/bin/sh
uname=$(/usr/bin/uname $@)
rv=$?
uname_m=$(/usr/bin/uname -m)
arch=${XBPS_ARCH%-musl}
# if XBPS_ARCH was reseted by `env -i` use original `/usr/bin/uname -m`
: ${arch:=$uname_m}
rv=$?
echo "$uname" |
sed "s/\(^\| \)$(/usr/bin/uname -n)\($\| \)/\1void\2/" |
sed "s/$uname_m/$arch/"