diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | NEWS | 12 | ||||
-rw-r--r-- | asia | 4 | ||||
-rw-r--r-- | backward | 26 | ||||
-rw-r--r-- | checklinks.awk | 27 | ||||
-rw-r--r-- | etcetera | 17 | ||||
-rw-r--r-- | europe | 1 | ||||
-rw-r--r-- | theory.html | 1 | ||||
-rw-r--r-- | zdump.c | 4 | ||||
-rw-r--r-- | ziguard.awk | 14 |
10 files changed, 91 insertions, 18 deletions
@@ -825,7 +825,8 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab touch $@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi - $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) + $(AWK) -f checklinks.awk -v backcheck=backward \ + $(TDATA_TO_CHECK) $(AWK) -f checklinks.awk tzdata.zi touch $@ @@ -3,9 +3,21 @@ News for the tz database Unreleased, experimental changes Briefly: + Move links to 'backward'. + In vanguard form, GMT is now a Zone and Etc/GMT a link. Simplify four Ontario zones into one. Fix a Y2438 bug when reading TZif data. + Changes to data + + Move links to 'backward' to ease and simplify link maintenance. + This affects generated data only if you use 'make BACKWARD='. + + GMT is now a Zone and Etc/GMT a link instead of vice versa, + as GMT is needed for leap second support whereas Etc/GMT is not. + However, this change exposes a bug in TZUpdater 2.3.2 so it is + present only in vanguard form for now. + Changes to past timestamps Simplify four Ontario zones to one, as the post-1970 differences @@ -1172,10 +1172,6 @@ Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14 3:00 - +03 2017 Oct 29 1:00u 2:00 EUAsia EE%sT -# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72. -# However, for various reasons many users expect to find it under Europe. -Link Asia/Nicosia Europe/Nicosia - # Georgia # From Paul Eggert (1994-11-19): # Today's _Economist_ (p 60) reports that Georgia moved its clocks forward @@ -46,6 +46,8 @@ Link Asia/Shanghai Asia/Chongqing Link Asia/Shanghai Asia/Chungking Link Asia/Dhaka Asia/Dacca Link Asia/Shanghai Asia/Harbin +# Istanbul is in both continents. +Link Europe/Istanbul Asia/Istanbul Link Asia/Urumqi Asia/Kashgar Link Asia/Kathmandu Asia/Katmandu Link Asia/Macau Asia/Macao @@ -89,18 +91,42 @@ Link Pacific/Easter Chile/EasterIsland Link America/Havana Cuba Link Africa/Cairo Egypt Link Europe/Dublin Eire +# Vanguard section, for most .zi parsers. +#Link GMT Etc/GMT +#Link GMT Etc/GMT+0 +#Link GMT Etc/GMT-0 +#Link GMT Etc/GMT0 +#Link GMT Etc/Greenwich +# Rearguard section, for TZUpdater 2.3.2 and earlier. +Link Etc/GMT Etc/GMT+0 +Link Etc/GMT Etc/GMT-0 +Link Etc/GMT Etc/GMT0 +Link Etc/GMT Etc/Greenwich +# End of rearguard section. Link Etc/UTC Etc/UCT +Link Etc/UTC Etc/Universal +Link Etc/UTC Etc/Zulu Link Europe/London Europe/Belfast Link Europe/Kyiv Europe/Kiev +# Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72. +# However, for various reasons many users expect to find it under Europe. +Link Asia/Nicosia Europe/Nicosia Link Europe/Chisinau Europe/Tiraspol Link Europe/Kyiv Europe/Uzhgorod Link Europe/Kyiv Europe/Zaporozhye Link Europe/London GB Link Europe/London GB-Eire +# Vanguard section, for most .zi parsers. +#Link GMT GMT+0 +#Link GMT GMT-0 +#Link GMT GMT0 +#Link GMT Greenwich +# Rearguard section, for TZUpdater 2.3.2 and earlier. Link Etc/GMT GMT+0 Link Etc/GMT GMT-0 Link Etc/GMT GMT0 Link Etc/GMT Greenwich +# End of rearguard section. Link Asia/Hong_Kong Hongkong Link Africa/Abidjan Iceland Link Asia/Tehran Iran diff --git a/checklinks.awk b/checklinks.awk index f309010..45f67e3 100644 --- a/checklinks.awk +++ b/checklinks.awk @@ -7,6 +7,18 @@ BEGIN { # It is a newline so that it cannot match a valid name. # It is not null so that its slot does not appear unset. Zone = "\n" + + if (!zone_table) zone_table = "zone.tab" + + while (getline <zone_table) { + if (/^#/) continue + zone_cc[$3] = $1 + } + + # As a special case, a link to "GMT" is allowed in a continental file. + # Remove this special case once the hack for TZUpdater 2.3.2 is + # moved from main to reaguard form. + zone_cc["GMT"] = 1 } /^Z/ { @@ -19,6 +31,7 @@ BEGIN { status = 1 } defined[$2] = Zone + last_zone = $2 } /^L/ { @@ -32,6 +45,20 @@ BEGIN { } status = 1 } + if (backcheck) { + backward = FILENAME == backcheck + if (!!zone_cc[$3] == backward) { + shouldbe = backward ? "a continental file" : "'backward'" + printf "%s:%d: %s: Link should be in %s\n", \ + FILENAME, FNR, $3, shouldbe + status = 1 + } + if (!backward && $2 != last_zone) { + printf "%s:%d: Link %s should come just after Zone %s\n", \ + FILENAME, FNR, $3, $2 + status = 1 + } + } used[$2] = 1 defined[$3] = $2 } @@ -16,26 +16,23 @@ # Do not use a POSIX TZ setting like TZ='GMT+4', which is four hours # behind GMT but uses the completely misleading abbreviation "GMT". -Zone Etc/GMT 0 - GMT - # The following zone is used by tzcode functions like gmtime, # which load the "UTC" file to handle seconds properly. Zone Etc/UTC 0 - UTC +# Functions like gmtime load the "GMT" file to handle leap seconds properly. +# Vanguard section, which works with most .zi parsers. +#Zone GMT 0 - GMT +# Rearguard section, for TZUpdater 2.3.2 and earlier. +Zone Etc/GMT 0 - GMT + # The following link uses older naming conventions, # but it belongs here, not in the file 'backward', # as it is needed for tzcode releases through 2022a, # where functions like gmtime load "GMT" instead of the "Etc/UTC". # We want this to work even on installations that omit 'backward'. Link Etc/GMT GMT - -Link Etc/UTC Etc/Universal -Link Etc/UTC Etc/Zulu - -Link Etc/GMT Etc/Greenwich -Link Etc/GMT Etc/GMT-0 -Link Etc/GMT Etc/GMT+0 -Link Etc/GMT Etc/GMT0 +# End of rearguard section. # Be consistent with POSIX TZ settings in the Zone names, # even though this is the opposite of what many people expect. @@ -3734,7 +3734,6 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 1:00 EEST 2015 Nov 8 1:00u 2:00 EU EE%sT 2016 Sep 7 3:00 - +03 -Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. # Ukraine # diff --git a/theory.html b/theory.html index 56390ae..298db86 100644 --- a/theory.html +++ b/theory.html @@ -329,6 +329,7 @@ still supported. These legacy names are mostly defined in the file '<code>etcetera</code>'. Also, the file '<code>backward</code>' defines the legacy names +'<code>Etc/GMT0</code>', '<code>Etc/GMT-0</code>', '<code>Etc/GMT+0</code>', '<code>GMT0</code>', '<code>GMT-0</code>' and '<code>GMT+0</code>', and the file '<code>northamerica</code>' defines the legacy names '<code>EST5EDT</code>', '<code>CST6CDT</code>', @@ -281,9 +281,9 @@ gmtzinit(void) if (USE_LOCALTIME_RZ) { /* Try "GMT" first to find out whether this is one of the rare platforms where time_t counts leap seconds; this works due to - the "Link Etc/GMT GMT" line in the "etcetera" file. If "GMT" + the "Zone GMT 0 - GMT" line in the "etcetera" file. If "GMT" fails, fall back on "GMT0" which might be similar due to the - "Link Etc/GMT GMT0" line in the "backward" file, and which + "Link GMT GMT0" line in the "backward" file, and which should work on all POSIX platforms. The rest of zdump does not use the "GMT" abbreviation that comes from this setting, so it is OK to use "GMT" here rather than the more-modern "UTC" which diff --git a/ziguard.awk b/ziguard.awk index 0556cc4..a864f9f 100644 --- a/ziguard.awk +++ b/ziguard.awk @@ -15,6 +15,9 @@ # after main became rearguard and vanguard became main). # There is no need to convert rearguard to other forms. # +# When converting to vanguard form, the output can use the line +# "Zone GMT 0 - GMT" which TZUpdater 2.3.2 mistakenly rejects. +# # When converting to vanguard form, the output can use negative SAVE # values. # @@ -151,6 +154,17 @@ DATAFORM != "main" { } } + # In vanguard form, use the line "Zone GMT 0 - GMT" instead of + # "Zone Etc/GMT 0 - GMT" and adjust Link lines accordingly. + # This works around a bug in TZUpdater 2.3.2. + if (/^#?(Zone|Link)[\t ]+(Etc\/)?GMT[\t ]/) { + if (($2 == "GMT") == (DATAFORM == "vanguard")) { + uncomment = in_comment + } else { + comment_out = !in_comment + } + } + if (uncomment) { sub(/^#/, "") } |