1996-09-08 15:50:24 -04:00
|
|
|
# Check tz tables for consistency.
|
|
|
|
|
|
2005-07-14 14:06:15 -04:00
|
|
|
# Contributed by Paul Eggert.
|
1996-09-08 15:50:24 -04:00
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
|
FS = "\t"
|
|
|
|
|
|
|
|
|
|
if (!iso_table) iso_table = "iso3166.tab"
|
2014-07-31 15:20:45 -07:00
|
|
|
if (!zone_table) zone_table = "zone1970.tab"
|
1996-09-08 15:50:24 -04:00
|
|
|
if (!want_warnings) want_warnings = -1
|
|
|
|
|
|
Fix minor problems found by static checking.
Mostly this moves links so that files can be zic'ed standalone.
* antarctica (Antarctica/McMurdo): Move to australasia,
* australasia (Pacific/Johnston): Move to northamerica.
* checktab.awk: Add special case for America/Montreal, pending
the tzwinnow approach.
* northamerica (America/Anguilla, America/Dominica, America/Grenada)
(America/Guadeloupe, America/St_Barthelemy, America/Marigot)
(America/Montserrat, America/St_Kitts, America/St_Lucia)
(America/St_Vincent, America/Tortola, America/St_Thomas):
Move to southamerica.
* southamerica: Receive above-described moves.
* zic.c (writezone): Remove unused local.
2013-09-11 02:21:27 -07:00
|
|
|
# A special (and we hope temporary) case.
|
|
|
|
|
tztab["America/Montreal"] = 1
|
|
|
|
|
|
Revert almost all the zone-to-link changes, keeping only west Africa.
This should better address concerns about large-scale changes.
We can do the rest of these changes later, as they're not urgent.
* backward (Africa/Asmera, Asia/Saigon): Restore old links.
* checktab.awk (tztab): Handle zones that should probably be
turned into links some day.
* africa (Africa/Luanda, Africa/Porto-Novo, Africa/Gaborone)
(Africa/Bujumbura, Africa/Douala, Africa/Bangui, Indian/Comoro)
(Africa/Kinshasa, Africa/Lubumbashi, Africa/Brazzaville)
(Africa/Djibouti, Africa/Malabo, Africa/Asmara, Africa/Addis_Ababa)
(Africa/Libreville, Africa/Maseru, Indian/Antananarivo)
(Africa/Blantyre, Indian/Mayotte, Africa/Niamey, Africa/Kigali)
(Africa/Mogadishu, Africa/Mbabane, Africa/Dar_es_Salaam)
(Africa/Kampala, Africa/Lusaka, Africa/Harare):
* asia (Asia/Bahrain, Asia/Phnom_Penh, Asia/Kuwait)
(Asia/Vientiane, Asia/Muscat, Asia/Ho_Chi_Minh, Asia/Aden):
* australasia (Pacific/Saipan, Pacific/Midway):
* northamerica, southamerica (America/Antigua, America/Cayman):
New zones, restoring 2014e data. Corresponding links removed.
* NEWS: Document the above.
2014-07-31 21:28:12 -07:00
|
|
|
# Some more special cases; these are zones that should probably
|
|
|
|
|
# be turned into links.
|
|
|
|
|
if (zone_table == "zone1970.tab") {
|
|
|
|
|
tztab["Africa/Addis_Ababa"] = 1
|
|
|
|
|
tztab["Africa/Asmara"] = 1
|
|
|
|
|
tztab["Africa/Dar_es_Salaam"] = 1
|
|
|
|
|
tztab["Africa/Djibouti"] = 1
|
|
|
|
|
tztab["Africa/Kampala"] = 1
|
|
|
|
|
tztab["Africa/Mogadishu"] = 1
|
|
|
|
|
tztab["America/Antigua"] = 1
|
|
|
|
|
tztab["America/Cayman"] = 1
|
|
|
|
|
tztab["Asia/Aden"] = 1
|
|
|
|
|
tztab["Asia/Bahrain"] = 1
|
|
|
|
|
tztab["Asia/Ho_Chi_Minh"] = 1
|
|
|
|
|
tztab["Asia/Kuwait"] = 1
|
|
|
|
|
tztab["Asia/Muscat"] = 1
|
|
|
|
|
tztab["Asia/Phnom_Penh"] = 1
|
|
|
|
|
tztab["Asia/Vientiane"] = 1
|
|
|
|
|
tztab["Indian/Antananarivo"] = 1
|
|
|
|
|
tztab["Indian/Comoro"] = 1
|
|
|
|
|
tztab["Indian/Mayotte"] = 1
|
|
|
|
|
tztab["Pacific/Midway"] = 1
|
|
|
|
|
tztab["Pacific/Saipan"] = 1
|
|
|
|
|
}
|
|
|
|
|
|
1996-09-08 15:50:24 -04:00
|
|
|
while (getline <iso_table) {
|
|
|
|
|
iso_NR++
|
|
|
|
|
if ($0 ~ /^#/) continue
|
|
|
|
|
if (NF != 2) {
|
1999-09-28 10:50:21 -04:00
|
|
|
printf "%s:%d: wrong number of columns\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
iso_table, iso_NR >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
cc = $1
|
|
|
|
|
name = $2
|
|
|
|
|
if (cc !~ /^[A-Z][A-Z]$/) {
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s:%d: invalid country code '%s'\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
iso_table, iso_NR, cc >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
if (cc <= cc0) {
|
1999-09-28 10:53:04 -04:00
|
|
|
if (cc == cc0) {
|
|
|
|
|
s = "duplicate";
|
|
|
|
|
} else {
|
|
|
|
|
s = "out of order";
|
|
|
|
|
}
|
|
|
|
|
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s:%d: country code '%s' is %s\n", \
|
1999-09-28 10:53:04 -04:00
|
|
|
iso_table, iso_NR, cc, s \
|
1996-09-08 15:50:24 -04:00
|
|
|
>>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
cc0 = cc
|
|
|
|
|
if (name2cc[name]) {
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s:%d: '%s' and '%s' have the sname name\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
iso_table, iso_NR, name2cc[name], cc \
|
|
|
|
|
>>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
name2cc[name] = cc
|
|
|
|
|
cc2name[cc] = name
|
|
|
|
|
cc2NR[cc] = iso_NR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cc0 = ""
|
|
|
|
|
|
|
|
|
|
while (getline <zone_table) {
|
|
|
|
|
zone_NR++
|
|
|
|
|
if ($0 ~ /^#/) continue
|
|
|
|
|
if (NF != 3 && NF != 4) {
|
1999-09-28 10:50:21 -04:00
|
|
|
printf "%s:%d: wrong number of columns\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
zone_table, zone_NR >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
split($1, cca, /,/)
|
|
|
|
|
cc = cca[1]
|
1996-09-08 15:50:24 -04:00
|
|
|
coordinates = $2
|
|
|
|
|
tz = $3
|
|
|
|
|
comments = $4
|
|
|
|
|
if (cc < cc0) {
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s:%d: country code '%s' is out of order\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
zone_table, zone_NR, cc >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
cc0 = cc
|
2014-07-19 15:44:39 -07:00
|
|
|
tztab[tz] = 1
|
|
|
|
|
tz2comments[tz] = comments
|
|
|
|
|
tz2NR[tz] = zone_NR
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
for (i in cca) {
|
|
|
|
|
cc = cca[i]
|
|
|
|
|
cctz = cc tz
|
|
|
|
|
cctztab[cctz] = 1
|
|
|
|
|
if (cc2name[cc]) {
|
1996-09-08 15:50:24 -04:00
|
|
|
cc_used[cc]++
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
} else {
|
1996-09-08 15:50:24 -04:00
|
|
|
printf "%s:%d: %s: unknown country code\n", \
|
|
|
|
|
zone_table, zone_NR, cc >>"/dev/stderr"
|
|
|
|
|
status = 1
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
}
|
1996-09-08 15:50:24 -04:00
|
|
|
}
|
|
|
|
|
if (coordinates !~ /^[-+][0-9][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9]$/ \
|
|
|
|
|
&& coordinates !~ /^[-+][0-9][0-9][0-5][0-9][0-5][0-9][-+][01][0-9][0-9][0-5][0-9][0-5][0-9]$/) {
|
|
|
|
|
printf "%s:%d: %s: invalid coordinates\n", \
|
|
|
|
|
zone_table, zone_NR, coordinates >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Move links to 'backward' if they exist only because of country codes.
* backward: Move links here from other files, if the only reason
they existed was to fill out zone.tab. Zones are now allowed to
cross national borders, so a zone now need not exist merely
because there's a national border. Sort the list consistently.
None of this changes any time stamp in the database.
* checktab.awk: Don't require that zone.tab's column 3 be unique.
* europe (Europe/Jersey, Europe/Guernsey, Europe/Isle_of_Man)
(Europe/Mariehamn, Europe/Busingen, Europe/Vatican, Europe/San_Marino)
(Arctic/Longyearbyen, Europe/Ljubljana, Europe/Podgorica)
(Europe/Sarajevo, Europe/Skopje, Europe/Zagreb, Europe/Bratislava):
* northamerica (America/St_Barthelemy, America/Marigot):
* southamerica (America/Lower_Princes, America/Kralendijk):
Move links to 'backward'.
* zone.tab: Give more details about how different rows can have
duplicate column 1 or column 3. For each link moved to 'backward',
change column 3 to be the non-backward name.
2013-08-09 02:05:40 -07:00
|
|
|
for (cctz in cctztab) {
|
|
|
|
|
cc = substr (cctz, 1, 2)
|
|
|
|
|
tz = substr (cctz, 3)
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
if (1 < cc_used[cc]) {
|
|
|
|
|
comments_needed[tz] = cc
|
1996-09-08 15:50:24 -04:00
|
|
|
}
|
|
|
|
|
}
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
for (cctz in cctztab) {
|
|
|
|
|
cc = substr (cctz, 1, 2)
|
|
|
|
|
tz = substr (cctz, 3)
|
|
|
|
|
if (!comments_needed[tz] && tz2comments[tz]) {
|
|
|
|
|
printf "%s:%d: unnecessary comment '%s'\n", \
|
|
|
|
|
zone_table, tz2NR[tz], tz2comments[tz] \
|
|
|
|
|
>>"/dev/stderr"
|
|
|
|
|
tz2comments[tz] = 0
|
|
|
|
|
status = 1
|
|
|
|
|
} else if (comments_needed[tz] && !tz2comments[tz]) {
|
|
|
|
|
printf "%s:%d: missing comment for %s\n", \
|
|
|
|
|
zone_table, tz2NR[tz], comments_needed[tz] \
|
|
|
|
|
>>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
1996-09-08 15:50:24 -04:00
|
|
|
FS = " "
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-20 19:01:21 -07:00
|
|
|
$1 ~ /^#/ { next }
|
|
|
|
|
|
1996-09-08 15:50:24 -04:00
|
|
|
{
|
2014-03-20 19:01:21 -07:00
|
|
|
tz = rules = ""
|
|
|
|
|
if ($1 == "Zone") {
|
|
|
|
|
tz = $2
|
|
|
|
|
ruleUsed[$4] = 1
|
New file time.tab, superseding zone.tab
It allows multiple country codes per zone. Switch code and data to
use the new format, along with the recently-added Crozet Islands entry.
The old zone.tab file is still installed but is deprecated.
The new file uses UTF-8; add commentary saying that iso3166.tab is
planned to change to UTF-8.
* Theory, tzselect.8 (FILES): zone.tab -> time.tab.
* africa (Indian/Alfred_Faure): Remove link.
* antarctica: Mention Possession Island in comments.
* checktab.awk: Add support for checking time.tab.
* iso3166.tab: Mention planned switch to UTF-8.
Update ISO 3166-1 Newsletter from VI-15 to VI-16.
* time.tab: New file.
* tzselect.ksh (zonetabtype): New variable.
Add undocumented -t option, meant for developer testing.
(TZ_ZONE_TABLE): Use zonetabtype.
(output_distances, countries, regions, TZ): Support time.tab format.
(quoted_continents, distance_table, countries, regions)
(TZ, TZ_for_date): Quote shell strings more carefully.
* zone.tab: Refer to time.tab for detailed comments about format.
(Indian/Alfred_Faure): Remove.
* Makefile (TIMETABLES): New macro.
(TABDATA, install, check_tables): Use it.
(check_character_set, check_tables): Check time.tab too.
(check_time_t_alternatives): Use time.tab, not zone.tab.
* NEWS: Document the above.
2014-07-18 13:16:10 -07:00
|
|
|
} else if ($1 == "Link" && zone_table == "zone.tab") {
|
1996-09-08 15:50:24 -04:00
|
|
|
# Ignore Link commands if source and destination basenames
|
|
|
|
|
# are identical, e.g. Europe/Istanbul versus Asia/Istanbul.
|
|
|
|
|
src = $2
|
|
|
|
|
dst = $3
|
|
|
|
|
while ((i = index(src, "/"))) src = substr(src, i+1)
|
|
|
|
|
while ((i = index(dst, "/"))) dst = substr(dst, i+1)
|
|
|
|
|
if (src != dst) tz = $3
|
2014-03-20 19:01:21 -07:00
|
|
|
} else if ($1 == "Rule") {
|
|
|
|
|
ruleDefined[$2] = 1
|
|
|
|
|
} else {
|
|
|
|
|
ruleUsed[$2] = 1
|
1996-09-08 15:50:24 -04:00
|
|
|
}
|
|
|
|
|
if (tz && tz ~ /\//) {
|
Move links to 'backward' if they exist only because of country codes.
* backward: Move links here from other files, if the only reason
they existed was to fill out zone.tab. Zones are now allowed to
cross national borders, so a zone now need not exist merely
because there's a national border. Sort the list consistently.
None of this changes any time stamp in the database.
* checktab.awk: Don't require that zone.tab's column 3 be unique.
* europe (Europe/Jersey, Europe/Guernsey, Europe/Isle_of_Man)
(Europe/Mariehamn, Europe/Busingen, Europe/Vatican, Europe/San_Marino)
(Arctic/Longyearbyen, Europe/Ljubljana, Europe/Podgorica)
(Europe/Sarajevo, Europe/Skopje, Europe/Zagreb, Europe/Bratislava):
* northamerica (America/St_Barthelemy, America/Marigot):
* southamerica (America/Lower_Princes, America/Kralendijk):
Move links to 'backward'.
* zone.tab: Give more details about how different rows can have
duplicate column 1 or column 3. For each link moved to 'backward',
change column 3 to be the non-backward name.
2013-08-09 02:05:40 -07:00
|
|
|
if (!tztab[tz]) {
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s: no data for '%s'\n", zone_table, tz \
|
1996-09-08 15:50:24 -04:00
|
|
|
>>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
zoneSeen[tz] = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
END {
|
2014-03-20 19:01:21 -07:00
|
|
|
for (tz in ruleDefined) {
|
|
|
|
|
if (!ruleUsed[tz]) {
|
|
|
|
|
printf "%s: Rule never used\n", tz
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-19 15:44:39 -07:00
|
|
|
for (tz in tztab) {
|
1996-09-08 15:50:24 -04:00
|
|
|
if (!zoneSeen[tz]) {
|
Don't abuse "`" to mean open quote.
This was appropriate before Unicode, where "`" and "'" often balanced
in visual output, but that's been obsolete for a while.
Overall, single-quote 'like this' instead of `like this', and
double-quote "like this" or (in typeset output) “like this”
instead of ``like this''. While we're at it, fix some glitches
with hyphens versus minus versus en dash versus em dash.
* Makefile ($(MANTXTS)): Use UTF-8 locale to produce *.txt output.
* checktab.awk, tzselect.ksh:
Quote 'like this' in diagnostics, instead of `like this'.
* date.1, newctime.3, newtzset.3, time2posix.3, zic.8 (q, lq, rq):
New macros. Use them for better double-quoting in output.
* workman.sh: Tell Perl that its stdin and stdout are UTF-8.
* NEWS: Document this.
2014-06-15 13:27:37 -07:00
|
|
|
printf "%s:%d: no Zone table for '%s'\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
zone_table, tz2NR[tz], tz >>"/dev/stderr"
|
|
|
|
|
status = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (0 < want_warnings) {
|
|
|
|
|
for (cc in cc2name) {
|
|
|
|
|
if (!cc_used[cc]) {
|
1999-11-04 16:41:34 -05:00
|
|
|
printf "%s:%d: warning: " \
|
1999-09-28 10:50:21 -04:00
|
|
|
"no Zone entries for %s (%s)\n", \
|
1996-09-08 15:50:24 -04:00
|
|
|
iso_table, cc2NR[cc], cc, cc2name[cc]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exit status
|
|
|
|
|
}
|