diff options
Diffstat (limited to 'contrib/tzdata/checktab.awk')
-rw-r--r-- | contrib/tzdata/checktab.awk | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/tzdata/checktab.awk b/contrib/tzdata/checktab.awk index 2397673..393ab19 100644 --- a/contrib/tzdata/checktab.awk +++ b/contrib/tzdata/checktab.awk @@ -126,6 +126,7 @@ $1 ~ /^#/ { next } if ($1 == "Zone") { tz = $2 ruleUsed[$4] = 1 + if ($5 ~ /%/) rulePercentUsed[$4] = 1 } else if ($1 == "Link" && zone_table == "zone.tab") { # Ignore Link commands if source and destination basenames # are identical, e.g. Europe/Istanbul versus Asia/Istanbul. @@ -136,8 +137,10 @@ $1 ~ /^#/ { next } if (src != dst) tz = $3 } else if ($1 == "Rule") { ruleDefined[$2] = 1 + if ($10 != "-") ruleLetters[$2] = 1 } else { ruleUsed[$2] = 1 + if ($3 ~ /%/) rulePercentUsed[$2] = 1 } if (tz && tz ~ /\//) { if (!tztab[tz]) { @@ -156,6 +159,12 @@ END { status = 1 } } + for (tz in ruleLetters) { + if (!rulePercentUsed[tz]) { + printf "%s: Rule contains letters never used\n", tz + status = 1 + } + } for (tz in tztab) { if (!zoneSeen[tz]) { printf "%s:%d: no Zone table for '%s'\n", \ |