summaryrefslogtreecommitdiffstats
path: root/contrib/tzdata/ziguard.awk
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2018-05-08 15:29:57 -0300
committerLuiz Souza <luiz@netgate.com>2018-05-08 15:29:57 -0300
commit61033f55dc6b6b9c295e0ade753c1d0b142ddd1b (patch)
treedca9d1eea2391625aced6348fd39db2bd5c8cf3a /contrib/tzdata/ziguard.awk
parented209f46dbcc4a79d277e0d2e93dc51a1f331be5 (diff)
parent2128561f0f5745f9e9330fbd5910e68e71159fcc (diff)
downloadFreeBSD-src-61033f55dc6b6b9c295e0ade753c1d0b142ddd1b.zip
FreeBSD-src-61033f55dc6b6b9c295e0ade753c1d0b142ddd1b.tar.gz
Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_4
Diffstat (limited to 'contrib/tzdata/ziguard.awk')
-rw-r--r--contrib/tzdata/ziguard.awk58
1 files changed, 48 insertions, 10 deletions
diff --git a/contrib/tzdata/ziguard.awk b/contrib/tzdata/ziguard.awk
index 6da3691..42e2910 100644
--- a/contrib/tzdata/ziguard.awk
+++ b/contrib/tzdata/ziguard.awk
@@ -13,19 +13,30 @@
# rearguard format.
BEGIN {
- dst_type["vanguard.zi"] = 1
- dst_type["main.zi"] = 1
- dst_type["rearguard.zi"] = 1
+ dataform_type["vanguard"] = 1
+ dataform_type["main"] = 1
+ dataform_type["rearguard"] = 1
- # The command line should set OUTFILE to the name of the output file.
- if (!dst_type[outfile]) exit 1
- vanguard = outfile == "vanguard.zi"
+ # The command line should set DATAFORM.
+ if (!dataform_type[DATAFORM]) exit 1
+ vanguard = DATAFORM == "vanguard"
}
/^Zone/ { zone = $2 }
-outfile != "main.zi" {
+DATAFORM != "main" {
in_comment = /^#/
+ uncomment = comment_out = 0
+
+ # If the line should differ due to Czechoslovakia using negative SAVE values,
+ # uncomment the desired version and comment out the undesired one.
+ if (zone == "Europe/Prague" && /1947 Feb 23/) {
+ if (($(in_comment + 2) != "-") == vanguard) {
+ uncomment = in_comment
+ } else {
+ comment_out = !in_comment
+ }
+ }
# If this line should differ due to Ireland using negative SAVE values,
# uncomment the desired version and comment out the undesired one.
@@ -37,11 +48,38 @@ outfile != "main.zi" {
if ((Rule_Eire \
|| (Zone_Dublin_post_1968 && $(in_comment + 3) == "IST/GMT")) \
== vanguard) {
- sub(/^#/, "")
- } else if (/^[^#]/) {
- sub(/^/, "#")
+ uncomment = in_comment
+ } else {
+ comment_out = !in_comment
}
}
+
+ # If this line should differ due to Namibia using Rule SAVE suffixes,
+ # uncomment the desired version and comment out the undesired one.
+ Rule_Namibia = /^#?Rule[\t ]+Namibia[\t ]/
+ Zone_using_Namibia_rule \
+ = (zone == "Africa/Windhoek" \
+ && ($(in_comment + 2) == "Namibia" \
+ || (1994 <= $(in_comment + 4) && $(in_comment + 4) <= 2017) \
+ || in_comment + 3 == NF))
+ if (Rule_Namibia || Zone_using_Namibia_rule) {
+ if ((Rule_Namibia \
+ ? ($(in_comment + 9) ~ /^-/ \
+ || ($(in_comment + 9) == 0 && $(in_comment + 10) == "CAT")) \
+ : $(in_comment + 1) == "2:00" && $(in_comment + 2) == "Namibia") \
+ == vanguard) {
+ uncomment = in_comment
+ } else {
+ comment_out = !in_comment
+ }
+ }
+
+ if (uncomment) {
+ sub(/^#/, "")
+ }
+ if (comment_out) {
+ sub(/^/, "#")
+ }
}
# If a Link line is followed by a Zone line for the same data, comment
OpenPOWER on IntegriCloud