~nabijaczleweli/voreutils

336a58e5dfa0be73be65d5f005f57ff32881bb99 — наб 6 days ago cb91cf2
Don't check uname -v on FreeBSD, which has broken uname(1)
1 files changed, 12 insertions(+), 2 deletions(-)

M tests/uname
M tests/uname => tests/uname +12 -2
@@ 32,12 32,22 @@ errstr="$("${tmpdir}$altname" 2>&1 > /dev/null)"; err=$?
"${tmpdir}uname" -s > "${tmpdir}uname--s"
"${tmpdir}uname" -o | cmp - "${tmpdir}uname--s" || echo "uname: -o doesn't match -s" >&3

for s in '' '-s'; do for n in '' '-n'; do for r in '' '-r'; do for v in '' '-v'; do for m in '' '-m'; do for p in '' '-p'; do
# FreeBSD has broken uname(1) -v:
#   https://twitter.com/nabijaczleweli/status/1402310047783399426
#   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256486
if [ "$(uname)" = "FreeBSD" ]; then
	V=
else
	V='-v'
fi

for s in '' '-s'; do for n in '' '-n'; do for r in '' '-r'; do for v in '' $V; do for m in '' '-m'; do for p in '' '-p'; do
	uname $s $n $r $v $m $p > "${tmpdir}uname $s $n $r $v $m $p"
	"${tmpdir}uname" $s $n $r $v $m $p | cmp - "${tmpdir}uname $s $n $r $v $m $p" || echo "uname: $s $n $r $v $m $p doesn't match system" >&3
done; done; done; done; done; done

if uname -i > "${tmpdir}uname -i" 2>/dev/null; then
if uname --version > /dev/null 2>&1; then  # Not checking for -i since FreeBSD also uses it, but for something different
	uname -i > "${tmpdir}uname -i"
	"${tmpdir}uname" -i | cmp - "${tmpdir}uname -i" || echo "uname: -s doesn't match system" >&3
else
	echo "uname: skipping -i, no system support" >&2