diff options
| author | Philip Paeps <philip@FreeBSD.org> | 2018-03-24 04:41:49 +0000 |
|---|---|---|
| committer | Philip Paeps <philip@FreeBSD.org> | 2018-03-24 04:41:49 +0000 |
| commit | 52b750c8aece7970ea49bc24b613e73c83b41b24 (patch) | |
| tree | 96157cd8fe120b32e798bee073ac15ac6b1e4d83 /checktab.awk | |
| parent | b6a2820ba92bea7acf4abeb38c198c71bcc554b8 (diff) | |
Diffstat (limited to 'checktab.awk')
| -rw-r--r-- | checktab.awk | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/checktab.awk b/checktab.awk index 2397673e92a9..393ab19f0bd8 100644 --- a/checktab.awk +++ b/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", \ |
