checktab.awk (259e2ad76d1da961cc34c2903cb5f72f28503eb8) checktab.awk (eebb9c2caea1584773ae4cec311cee1eea5b1655)
1# Check tz tables for consistency.
2
3# Contributed by Paul Eggert. This file is in the public domain.
4
5BEGIN {
6 FS = "\t"
7
8 if (!iso_table) iso_table = "iso3166.tab"

--- 69 unchanged lines hidden (view full) ---

78 cc0 = cc
79 tz0 = tz
80 tztab[tz] = 1
81 tz2NR[tz] = zone_NR
82 for (i in cca) {
83 cc = cca[i]
84 if (cc2name[cc]) {
85 cc_used[cc]++
1# Check tz tables for consistency.
2
3# Contributed by Paul Eggert. This file is in the public domain.
4
5BEGIN {
6 FS = "\t"
7
8 if (!iso_table) iso_table = "iso3166.tab"

--- 69 unchanged lines hidden (view full) ---

78 cc0 = cc
79 tz0 = tz
80 tztab[tz] = 1
81 tz2NR[tz] = zone_NR
82 for (i in cca) {
83 cc = cca[i]
84 if (cc2name[cc]) {
85 cc_used[cc]++
86 } else {
86 } else if (! (cc == "XX" && zone_table == "zonenow.tab")) {
87 printf "%s:%d: %s: unknown country code\n", \
88 zone_table, zone_NR, cc >>"/dev/stderr"
89 status = 1
90 }
91 }
92 if (coordinates !~ /^[-+][0-9][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9]$/ \
93 && coordinates !~ /^[-+][0-9][0-9][0-5][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9][0-5][0-9]$/) {
94 printf "%s:%d: %s: invalid coordinates\n", \

--- 10 unchanged lines hidden (view full) ---

105 used_max = 0
106 for (j in cca) {
107 cc = cca[j]
108 if (used_max < cc_used[cc]) {
109 used_max = cc_used[cc]
110 used_max_cc = cc
111 }
112 }
87 printf "%s:%d: %s: unknown country code\n", \
88 zone_table, zone_NR, cc >>"/dev/stderr"
89 status = 1
90 }
91 }
92 if (coordinates !~ /^[-+][0-9][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9]$/ \
93 && coordinates !~ /^[-+][0-9][0-9][0-5][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9][0-5][0-9]$/) {
94 printf "%s:%d: %s: invalid coordinates\n", \

--- 10 unchanged lines hidden (view full) ---

105 used_max = 0
106 for (j in cca) {
107 cc = cca[j]
108 if (used_max < cc_used[cc]) {
109 used_max = cc_used[cc]
110 used_max_cc = cc
111 }
112 }
113 if (used_max <= 1 && comments) {
113 if (used_max <= 1 && comments && zone_table != "zonenow.tab") {
114 printf "%s:%d: unnecessary comment '%s'\n", \
115 zone_table, i, comments \
116 >>"/dev/stderr"
117 status = 1
118 } else if (1 < used_max && !comments) {
119 printf "%s:%d: missing comment for %s\n", \
120 zone_table, i, used_max_cc \
121 >>"/dev/stderr"

--- 22 unchanged lines hidden (view full) ---

144 } else if ($1 == "Rule") {
145 ruleDefined[$2] = 1
146 if ($10 != "-") ruleLetters[$2] = 1
147 } else {
148 ruleUsed[$2] = 1
149 if ($3 ~ /%/) rulePercentUsed[$2] = 1
150 }
151 if (tz && tz ~ /\// && tz !~ /^Etc\//) {
114 printf "%s:%d: unnecessary comment '%s'\n", \
115 zone_table, i, comments \
116 >>"/dev/stderr"
117 status = 1
118 } else if (1 < used_max && !comments) {
119 printf "%s:%d: missing comment for %s\n", \
120 zone_table, i, used_max_cc \
121 >>"/dev/stderr"

--- 22 unchanged lines hidden (view full) ---

144 } else if ($1 == "Rule") {
145 ruleDefined[$2] = 1
146 if ($10 != "-") ruleLetters[$2] = 1
147 } else {
148 ruleUsed[$2] = 1
149 if ($3 ~ /%/) rulePercentUsed[$2] = 1
150 }
151 if (tz && tz ~ /\// && tz !~ /^Etc\//) {
152 if (!tztab[tz] && FILENAME != "backward") {
152 if (!tztab[tz] && FILENAME != "backward" \
153 && zone_table != "zonenow.tab") {
153 printf "%s: no data for '%s'\n", zone_table, tz \
154 >>"/dev/stderr"
155 status = 1
156 }
157 zoneSeen[tz] = 1
158 }
159}
160

--- 32 unchanged lines hidden ---
154 printf "%s: no data for '%s'\n", zone_table, tz \
155 >>"/dev/stderr"
156 status = 1
157 }
158 zoneSeen[tz] = 1
159 }
160}
161

--- 32 unchanged lines hidden ---