tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: grafana hits pkgsrc limits again
I tried that, but there seems to be a problem with the exit status in
a simple test case.
I've been revisiting this today, and I hit a problem during testing that
might be related. It seems the awk on NetBSD behaves differently when
reading from stdin, at least compared to other OS that I have handy that
also ship one-true-awk.
Simple reproducible testcase:
$ uname -rsm
NetBSD 10.0 amd64
$ awk --version
awk version 20200218
$ echo foo | awk 'BEGIN { while(getline < "-") }'; echo $?
2
$ uname -rsm
Darwin 23.5.0 arm64
$ awk --version
awk version 20200816
$ echo foo | awk 'BEGIN { while(getline < "-") }'; echo $?
0
$ uname -rsv
SunOS 5.11 joyent_20210826T002459Z
$ awk --version
awk version Aug 27, 2018
$ echo foo | awk 'BEGIN { while(getline < "-") }'; echo $?
0
$ nawk --version
awk version 20121220
$ echo foo | nawk 'BEGIN { while(getline < "-") }'; echo $?
0
Unfortunately this breaks the behaviour of the "distinfo" target when
nothing has changed. Annoyingly you can't even override it:
$ echo foo | awk 'BEGIN { while(getline < "-"); print "hi"; exit 0; }'; echo $?
hi
2
I don't really know what to do about this, unless there's some esoteric
workaround ... which I just found while writing this! If you specify
"/dev/stdin" instead then it does work. I'll send this anyway as I feel
it's a bug that should be fixed, and it probably explains the behaviour
difference you were seeing compared to me.
--
Jonathan Perkin - mnx.io - pkgsrc.smartos.org
Open Source Complete Cloud www.tritondatacenter.com
Home |
Main Index |
Thread Index |
Old Index