1 # Convert tzdata source into vanguard or rearguard form.
3 # Contributed by Paul Eggert. This file is in the public domain.
5 # This is not a general-purpose converter; it is designed for current tzdata.
7 # When converting to vanguard form, the output can use negative SAVE
10 # When converting to rearguard form, the output uses only nonnegative
11 # SAVE values. The idea is for the output data to simulate the behavior
12 # of the input data as best it can within the constraints of the
16 dst_type["vanguard.zi"] = 1
17 dst_type["main.zi"] = 1
18 dst_type["rearguard.zi"] = 1
20 # The command line should set OUTFILE to the name of the output file.
21 if (!dst_type[outfile]) exit 1
22 vanguard = outfile == "vanguard.zi"
27 outfile != "main.zi" {
30 # If this line should differ due to Ireland using negative SAVE values,
31 # uncomment the desired version and comment out the undesired one.
32 Rule_Eire = /^#?Rule[\t ]+Eire[\t ]/
33 Zone_Dublin_post_1968 \
34 = (zone == "Europe/Dublin" && /^#?[\t ]+[01]:00[\t ]/ \
35 && (!$(in_comment + 4) || 1968 < $(in_comment + 4)))
36 if (Rule_Eire || Zone_Dublin_post_1968) {
38 || (Zone_Dublin_post_1968 && $(in_comment + 3) == "IST/GMT")) \
47 # If a Link line is followed by a Zone line for the same data, comment
48 # out the Link line. This can happen if backzone overrides a Link
54 sub(/^Link/, "#Link", line[linkline[$2]])
60 for (i = 1; i <= NR; i++)