1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-12-23 20:51:05 +01:00
void-packages/common/wrappers/uname.sh

14 lines
298 B
Bash
Raw Normal View History

2024-03-29 08:12:19 +01:00
#!/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}
echo "$uname" |
sed "s/\(^\| \)$(/usr/bin/uname -n)\($\| \)/\1void\2/" |
sed "s/$uname_m/$arch/"
exit $rv