diff options
author | gjb <gjb@FreeBSD.org> | 2016-11-04 17:55:50 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-11-04 17:55:50 +0000 |
commit | 70abead4e0230e093e460214ec210f8842f0f59f (patch) | |
tree | 889aca68793c2728319acf0360d50a26e418565c /contrib/tzdata/checklinks.awk | |
parent | 0283a0b5f8f154324ad85e8e28fd51fb3d6fe071 (diff) | |
download | FreeBSD-src-70abead4e0230e093e460214ec210f8842f0f59f.zip FreeBSD-src-70abead4e0230e093e460214ec210f8842f0f59f.tar.gz |
MFC r308270:
MFV r308265: Update tzdata to 2016i.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/tzdata/checklinks.awk')
-rw-r--r-- | contrib/tzdata/checklinks.awk | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/contrib/tzdata/checklinks.awk b/contrib/tzdata/checklinks.awk new file mode 100644 index 0000000..5b3e157 --- /dev/null +++ b/contrib/tzdata/checklinks.awk @@ -0,0 +1,48 @@ +# Check links in tz tables. + +# Contributed by Paul Eggert. This file is in the public domain. + +BEGIN { + # Special marker indicating that the name is defined as a Zone. + # It is a newline so that it cannot match a valid name. + # It is not null so that its slot does not appear unset. + Zone = "\n" +} + +/^Zone/ { + if (defined[$2]) { + if (defined[$2] == Zone) { + printf "%s: Zone has duplicate definition\n", $2 + } else { + printf "%s: Link with same name as Zone\n", $2 + } + status = 1 + } + defined[$2] = Zone +} + +/^Link/ { + if (defined[$3]) { + if (defined[$3] == Zone) { + printf "%s: Link with same name as Zone\n", $3 + } else if (defined[$3] == $2) { + printf "%s: Link has duplicate definition\n", $3 + } else { + printf "%s: Link to both %s and %s\n", $3, defined[$3], $2 + } + status = 1 + } + used[$2] = 1 + defined[$3] = $2 +} + +END { + for (tz in used) { + if (defined[tz] != Zone) { + printf "%s: Link to non-zone\n", tz + status = 1 + } + } + + exit status +} |