[tz] New leapseconds.awk doesn't work on macOS
Paul Gilmartin
PaulGBoulder at AIM.com
Sat Jan 11 17:20:19 UTC 2020
On 2020-01-10, at 23:26:15, enh via tz <tz at iana.org> wrote:
>
> NetBSD already supported regular expressions in RS, and they
> upstreamed that to one-true-awk last year
> (https://github.com/onetrueawk/awk/commit/643a5a3dad633431c6ce8831944c23059a6be309
> and https://github.com/onetrueawk/awk/commit/7cae39dfa53e17981990f649a2f6b4c1ba856112)
> so hopefully all the OSes not using gawk can unify at some point. but,
> yeah, right now most awks don't have this ability. (for Android builds
> we're actually using one-true-awk on both Linux and macOS so
> developers working on one can't break developers working on the
> other.)
>
POSIX rules. Why take a chance to depend on leading edge features?:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_03
... RS ... If RS contains more than one character, the results are unspecified. ...
> On Fri, Jan 10, 2020 at 9:31 PM Deborah Goldsmith via tz <tz at iana.org> wrote:
>>
>> Would it make sense to just use tr to strip carriage returns from the file before feeding it to the awk script?
>>
No need. A sub() rule fixes it compatibly. Patch attached.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://mm.icann.org/pipermail/tz/attachments/20200111/e9b4a6f6/attachment.txt>
-------------- next part --------------
Tested on MacOS Mojave with simulated a la NIST input.
-- gil
More information about the tz
mailing list