ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/vendor/tzdata/dist/checklinks.awk
Revision: 7731
Committed: Mon Aug 15 01:45:05 2016 UTC (7 years, 8 months ago) by laffer1
File size: 1014 byte(s)
Log Message:
tzdata 2016f

File Contents

# Content
1 # Check links in tz tables.
2
3 # Contributed by Paul Eggert. This file is in the public domain.
4
5 BEGIN {
6 # Special marker indicating that the name is defined as a Zone.
7 # It is a newline so that it cannot match a valid name.
8 # It is not null so that its slot does not appear unset.
9 Zone = "\n"
10 }
11
12 /^Zone/ {
13 if (defined[$2]) {
14 if (defined[$2] == Zone) {
15 printf "%s: Zone has duplicate definition\n", $2
16 } else {
17 printf "%s: Link with same name as Zone\n", $2
18 }
19 status = 1
20 }
21 defined[$2] = Zone
22 }
23
24 /^Link/ {
25 if (defined[$3]) {
26 if (defined[$3] == Zone) {
27 printf "%s: Link with same name as Zone\n", $3
28 } else if (defined[$3] == $2) {
29 printf "%s: Link has duplicate definition\n", $3
30 } else {
31 printf "%s: Link to both %s and %s\n", $3, defined[$3], $2
32 }
33 status = 1
34 }
35 used[$2] = 1
36 defined[$3] = $2
37 }
38
39 END {
40 for (tz in used) {
41 if (defined[tz] != Zone) {
42 printf "%s: Link to non-zone\n", tz
43 status = 1
44 }
45 }
46
47 exit status
48 }