78 lines
2.0 KiB
Diff
78 lines
2.0 KiB
Diff
commit 7b6fb155cadd5e5ee70b55c2770e1bdd2f5d2a38
|
|
Author: Paul Eggert <eggert@cs.ucla.edu>
|
|
Date: Thu Sep 5 14:38:35 2024 -0700
|
|
|
|
Improve style checks for months
|
|
|
|
* checktab.awk: Check style of STDOFF and month names.
|
|
|
|
diff --git a/checktab.awk b/checktab.awk
|
|
index 9a26e465..15a3a697 100644
|
|
--- a/checktab.awk
|
|
+++ b/checktab.awk
|
|
@@ -9,6 +9,19 @@ BEGIN {
|
|
if (!zone_table) zone_table = "zone1970.tab"
|
|
if (!want_warnings) want_warnings = -1
|
|
|
|
+ monthabbr["Jan"] = 1
|
|
+ monthabbr["Feb"] = 1
|
|
+ monthabbr["Mar"] = 1
|
|
+ monthabbr["Apr"] = 1
|
|
+ monthabbr["May"] = 1
|
|
+ monthabbr["Jun"] = 1
|
|
+ monthabbr["Jul"] = 1
|
|
+ monthabbr["Aug"] = 1
|
|
+ monthabbr["Sep"] = 1
|
|
+ monthabbr["Oct"] = 1
|
|
+ monthabbr["Nov"] = 1
|
|
+ monthabbr["Dec"] = 1
|
|
+
|
|
while (getline <iso_table) {
|
|
iso_NR++
|
|
if ($0 ~ /^#/) continue
|
|
@@ -128,12 +141,14 @@ BEGIN {
|
|
$1 ~ /^#/ { next }
|
|
|
|
{
|
|
- tz = rules = ""
|
|
+ tz = rules = stdoff = ""
|
|
if ($1 == "Zone") {
|
|
tz = $2
|
|
+ stdoff = $3
|
|
ruleUsed[$4] = 1
|
|
if ($5 ~ /%/) rulePercentUsed[$4] = 1
|
|
- } else if ($1 == "Link" && zone_table == "zone.tab") {
|
|
+ } else if ($1 == "Link") {
|
|
+ if (zone_table == "zone.tab") {
|
|
# Ignore Link commands if source and destination basenames
|
|
# are identical, e.g. Europe/Istanbul versus Asia/Istanbul.
|
|
src = $2
|
|
@@ -141,13 +156,27 @@ $1 ~ /^#/ { next }
|
|
while ((i = index(src, "/"))) src = substr(src, i+1)
|
|
while ((i = index(dst, "/"))) dst = substr(dst, i+1)
|
|
if (src != dst) tz = $3
|
|
+ }
|
|
} else if ($1 == "Rule") {
|
|
ruleDefined[$2] = 1
|
|
if ($10 != "-") ruleLetters[$2] = 1
|
|
+ if (!monthabbr[$6]) {
|
|
+ printf "%s:%d: tricky month: %s\n", FILENAME, FNR, $6 \
|
|
+ >>"/dev/stderr"
|
|
+ status = 1
|
|
+ }
|
|
} else {
|
|
+ stdoff = $1
|
|
ruleUsed[$2] = 1
|
|
if ($3 ~ /%/) rulePercentUsed[$2] = 1
|
|
}
|
|
+
|
|
+ if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) {
|
|
+ printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \
|
|
+ >>"/dev/stderr"
|
|
+ status = 1
|
|
+ }
|
|
+
|
|
if (tz && tz ~ /\// && tz !~ /^Etc\//) {
|
|
if (!tztab[tz] && FILENAME != "backward" \
|
|
&& zone_table != "zonenow.tab") {
|