[tz] New leapseconds.awk doesn't work on macOS
Steffen Nurpmeso
steffen at sdaoden.eu
Sat Jan 11 20:44:37 UTC 2020
Guy Harris wrote in <4EDFA3A5-DA50-41BE-A248-EB850CB3A581 at alum.mit.edu>:
|On Jan 10, 2020, at 10:26 PM, 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
|
|macOS:
|
| https://opensource.apple.com/source/awk/awk-24/
|
|uses what I'm guessing, based on the Lucent copyrights, is the One \
|True Awk:
|
| https://github.com/onetrueawk/awk
|
|and I suspect most if not all of the *BSDs do so as well, but macOS \
|seems to be using a 2007-vintage version. Perhaps they should update, \
Debian systems use a historic mawk implementation worth
testing against, as it has no gsub and does not have character
classes (i finally have made a port for the Linux hobby
distribution i use to be able to do so easily).
And Sun xpg4/bin/awk expands \ sequences twice:
- gsub(/"/, "\\\\\"", LINE)
+ # Sun xpg4/bin/awk expands those twice:
+ # Notice that backslash escapes are interpreted twice, once in
+ # lexical processing of the string and once in processing the
+ # regular expression.
+ i = "\""
+ gsub(/"/, "\\\\\"", i)
+ i = (i == "\"")
+ gsub(/"/, (i ? "\\\\\"" : "\134\134\""), LINE)
|especially to a version that has...
|
|> (https://github.com/onetrueawk/awk/commit/643a5a3dad633431c6ce8831944c23\
|> 059a6be309
|> and https://github.com/onetrueawk/awk/commit/7cae39dfa53e17981990f649a2f\
|> 6b4c1ba856112)
|> so hopefully all the OSes not using gawk can unify at some point.
|
|...that change.
|
|> but, yeah, right now most awks don't have this ability.
|
|...so the tzcode should probably not depend on it.
And the other hand and in my experience packagers simply start
adding build time dependencies to work around such.
I unfortunately forced them to use gawk on MacOS and Debian in the
past...
--End of <4EDFA3A5-DA50-41BE-A248-EB850CB3A581 at alum.mit.edu>
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
More information about the tz
mailing list