* Makefile (ZFLAGS): Add a comment about how to enable meta-info.
* tzfile.5: Describe meta-information.
* zic.8: Document new options -n and -o, which cause zic to
generate meta-info.
* zic.c: Include <stddef.h>, for ptrdiff_t.
(genoption, genoptions, genname): New static vars.
(usage): Summarize new options.
(addgenoption, writevalue): New function.
(main, writezone): Add support for new options.
Reported by David Wheeler in
<http://mm.icann.org/pipermail/tz/2013-September/020083.html>.
* australasia (Fiji): Tweak spring-forward transitions to match
timeanddate.com's predictions.
* newtzset.3: Adjust Fiji example to match updated predictions.
Reword examples so that the English descriptions are more
consistent and are roughly in the same order as the TZ string
contents.
* northamerica (America/Cayman, America/Jamaica, America/Grand_Turk):
Change KMT from -5:07:12 to -5:07:11 (should be -5:07:10.41).
* zone.tab: Fine-tune geographical coordinates to match -5:07:10.41.
I chose the latitude to match the General Post Office, Kingston,
in the city center according to Google Maps.
Derived from Zefram's patch mentioned in
<http://mm.icann.org/pipermail/tz/2013-July/019470.html>.
With the current tz data, this affects only the Asia/Tehran file,
and it doesn't affect zdump output.
(YEAR_BY_YEAR_ZONE): New constant.
(stringzone): Return it when applicable.
(outzone): Search through a couple of extra years when extending.
Extend when we ran past 2037 in the data, too.
Also, improve the documentation and diagnostics in this area.
Suggested by Arthur David Olson in
<http://mm.icann.org/pipermail/tz/2013-September/020064.html>.
* tzfile.5, tzfile.h: Bump tzfile format to version 3.
* zic.8: Document -v better.
* zic.c (ZIC_VERSION): Bump from '2' to '3'.
(stringrule, stringzone, outzone): Report compatibility issues
more carefully, mentioning client dates.
Since we assume C89 now, it's safe to use vfprintf.
(verror): New function, with the old implementation of 'error'
but with a va_list API.
(error, warning): Use it.
(associate, gethms): Pass explicit %s to avoid GCC warning about
possibly unsafe formats.
(inzone, outzone, newabbr): Simplify by using the new error or
warning functions, avoiding the need to allocate and free memory.
* private.h (ATTRIBUTE_FORMAT): New macro.
Problem reported by Zefram in
<http://mm.icann.org/pipermail/tz/2013-September/020059.html>.
* localtime.c (tzparse): Elide simultaneous entries out of and
into DST if DST goes for an hour more than a year (actually, for
more than the DST offset more than a year). Since this
optimization can elide all entries, avoid looping forever looking
for entries that will never arrive. While we're at it, fix
another portability bug where the code assumed wraparound on
signed integer overflow.
* newtzset.3, tzfile.5: Mention that as an extension to POSIX,
if DST covers the entire year plus the DST offset, it's assumed to
be in effect all year. Give an example.
* zic.c (stringrule): Omit the "J" in January and February,
as this can save a byte or two in the output.
(rule_cmp): New function.
(stringzone): Do a better job of constructing the standard-time
abbreviation when there is perpetual DST. Defer to the new
stringrule to construct the times for perpetual DST.
Fix bug noted by Zefram, which caused a stray hour of standard
time to be inserted in an otherwise perpetual DST.
Previously, this code generated "WARST4WARST,J1/0,J365/24"
for the San Luis example; now it generates "WART4WARST,0/0,J365/25".
This implements a suggestion by Arthur David Olson.
Without this change, zic -v diagnoses problems with several zones
where it cannot compute a POSIX-equivalent TZ setting for time
stamps past 2038, which means these time stamps may be mishandled.
This entails a minor change to the binary tz file format, to allow
a minor extension to the POSIX TZ setting in the binary file,
instead of requiring a pure POSIX TZ setting. The zones fixed by
this change are America/Godthab, America/Santiago, Antarctica/Palmer,
Asia/Gaza, Asia/Hebron, Asia/Jerusalem, Pacific/Easter, and
Pacific/Fiji. The only zone that remains unfixed is
Asia/Tehran, which schedules clock transitions via the
Iranian calendar, something that even the extended TZ
setting cannot represent.
* localtime.c (getrule): Allow transition times to be signed.
* newtzset.3: Describe the extensions to POSIX TZ strings.
Some of these extensions (e.g., hours == 26) were already
implemented but were not documented. Give examples.
* tzfile.5: Document the relaxed restriction on the stored TZ
string; its hours component can be in the range -167..167 rather
than the POSIX-required 0..24. Refer to newtzset(5).
* zic.c (stringoffset): Allow hours to go up to 167.
(stringrule): Be willing to generate hours in the range -167
through 167.
* southamerica (SanLuis): Move October 2009 transition from here ...
(America/Argentina/San_Luis): ... to here. This causes San Luis
to not appear to be on perpetual DST.
In several places the code and documentation incorrectly used
"UTC" to describe time stamps that might precede the introduction
of UTC and for which UTC is therefore undefined. Change these
uses to "UT", as that's the correct term when talking about these
time stamps. Problem reported by Steve Allen in
<http://mm.icann.org/pipermail/tz/2013-September/019907.html>.
The major compatibility issue here is with 'zdump -v'; it'll now
output "UT" instead of the possibly-incorrect "UTC".
Many files change in minor ways in the commentary.
* zdump.c (show):
* zic.c (inzsub, addtype):
In output, say "UT" rather than "UTC", since the time stamp we're
talking about might precede the introduction of UTC.
These come from POSIX or similar platforms, or from the standard
'zic' implementation, but never got written down anywhere.
* Theory: Document other POSIX-inspired restrictions on names.
* zic.8 (DESCRIPTION): Document that zic's behavior is unspecified
if some names are duplicates. Sometimes it complains, sometimes not.
* northamerica (America/Anguilla, America/Dominica, America/Grenada)
(America/Guadeloupe, America/Montserrat, America/St_Kitts)
(America/St_Lucia, America/St_Vincent, America/Tortola)
(America/St_Thomas):
Link to America/Port_of_Spain instead of having a separate zone
that differs only in LMT. Each LMT entry is just a placeholder for
unavailable info, and by itself does not justify a separate zone.
Using just one zone simplifies maintenance, makes the runtime
a bit smaller, and can help simplify user selection of zones.
* southamerica (America/Aruba): Likewise, for America/Curacao.
* backward (America/Virgin):
* northamerica (America/St_Barthelemy, America/Marigot):
Adjust to the other changes, by not linking to a link.
This should allay concerns that the links would go away any time soon.
Suggested by Stephen Colebourne in
<http://mm.icann.org/pipermail/tz/2013-September/019801.html>.
Change "`" to "'"; these days, "`" and "'" are not symmetric.
* antarctica (Antarctica/McMurdo):
* 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 here from 'backward'. This reverts a 2013-08-09 change.
Other tz file readers had problems with the new pre1970 file, so
remove it and related changes. To recover the pre-1970 data,
instead change pre-1970 Zone entries in other files back to what
they were. Perhaps we'll try to find a better way someday.
* .gitignore: Remove back-pre1970.
* Makefile (BACKWARD): Remove. All uses changed back to 'backward'.
(AWK_SCRIPTS): Remove back-pre1970.awk.
(back-pre1970): Remove.
(clean_misc): Don't rm back-pre1970.
(check_public): Remove special case for pre1970.
* back-pre1970.awk, pre1970: Remove.
* backward (America/Anguilla, America/Antigua, America/Aruba)
(America/Atikokan, America/Blanc-Sablon, America/Cayman)
(America/Creston, America/Curacao, America/Dominica, America/Grenada)
(America/Guadeloupe, America/Montreal, America/Montserrat)
(America/Nassau, America/Port_of_Spain, America/St_Kitts)
(America/St_Lucia, America/St_Thomas, America/St_Vincent)
(America/Tortola): Remove, as these are zones again.
(America/Coral_Harbour, America/Kralendijk, America/Lower_Princes)
(America/Marigot, America/St_Barthelemy, America/Virgin):
Revert to previous links.
* northamerica (Mont, America/Blanc-Sablon, America/Montreal)
(America/Atikokan, America/Creston, America/Anguilla, America/Antigua)
(Bahamas, America/Nassau, America/Cayman, America/Dominica)
(America/Grenada, America/Guadeloupe, America/Montserrat)
(America/St_Kitts, America/St_Lucia, America/St_Vincent)
(America/Tortola, America/St_Thomas):
* southamerica (America/Aruba, America/Curacao, America/Port_of_Spain):
Restore these rules and zones.
* .gitignore: Add back-pre1970.
This lets us preserve information about pre-1970 time stamps when
we change a Zone to a Link to another zone whose time stamps agree
after 1970. This should address concerns about some recent
changes that removed this information. This implementation is a
stripped-down version of a suggestion by Andrew Main (Zefram) in
<http://mm.icann.org/pipermail/tz/2013-August/019615.html> and
<http://mm.icann.org/pipermail/tz/2013-August/019639.html> to
allow filtering tz data by date range. Unlike Zefram's
suggestion, this implementation supports only two date ranges,
namely 1970 on, using 'make BACKWARD=backward'; and all dates,
using 'make BACKWARD="pre1970 back-pre1970"'. At some point I'd
like to improve it to support arbitrary date ranges, but at least
we've now restored the data whose loss was of some concern.
* .gitignore: Add back-pre1970.
* Makefile (BACKWARD): New macro.
(YDATA): Use it instead of 'backward'.
(AWK_SCRIPTS): New macro, with additional script back-pre1970.awk.
(MISC): Use it.
(back-pre1970): New rule.
(clean_misc): Clean back-pre1970. Also clean time.tab, while we're
at it.
(check_public): Don't require pre1970 to stand alone.
* pre1970, back-pre1970.awk: New files.
This is like the previous change, except it entails a change to zone.tab.
The America/Montreal entry was created only because we mistakenly
thought that Montreal's and Toronto's post-1970 time stamps differed.
* backward, northamerica (America/Montreal):
Now a 'backward' link to America/Toronto.
* northamerica (Mont): Remove rules; no longer needed.
(America/Thunder_Bay): Refer to Toronto rules, not Mont.
This doesn't change any time stamps.
* zone.tab (America/Montreal): Remove.
(America/Toronto): Say that it also covers most of Quebec.
This continues in the series of moving entries to 'backward' if
they exist only because of obsolete tz rules about country codes.
In this case, Zone entries are changed to Links; this doesn't
affect any post-1970 time stamps, and the pre-1970 time stamps
are out of scope and are often of dubious reliability.
* backward, northamerica, southamerica (America/Anguilla)
(America/Antigua, America/Aruba, America/Blanc-Sablon)
(America/Cayman, America/Curacao, America/Dominica)
(America/Grenada, America/Guadeloupe, America/Montserrat)
(America/Port_of_Spain, America/St_Kitts, America/St_Lucia)
(America/St_Thomas, America/St_Vincent, America/Tortola):
Now 'backward' links to America/Puerto_Rico.
(America/Atikokan): Now a 'backward' link to America/Panama.
(America/Creston): Now a 'backward' link to America/Phoenix.
(America/Nassau): Now a 'backward' link to America/Toronto.
* backward (America/Coral_Harbour, America/Kralendijk)
(America/Lower_Princes, America/Marigot, America/St_Barthelemy)
(America/Virgin): Adjust to avoid link-to-a-link.
This fixes the 2013-08-15 change so that 'make check' works again.
* backward (America/Shiprock): Move this link here....
* northamerica (America/Shiprock): ... to here.
* tzselect.ksh (LC_ALL): Don't set this, so that the user can
use the locale's decimal point in coordinates.
(convert_coord): Rename from cvt1. All callers changed.
Support more ISO 6709 forms.
* tzselect.8: Document -c better, including the new forms.
These let the user select TZ based on geographical coordinates.
Combining '-c COORD' with '-t time' better insulates the user from
issues of nationality.
* tzselect.8 (SYNOPSIS, OPTIONS): Document the new options.
* tzselect.ksh: Implement them, using the great-circle special
case of the Vicenty formula for distances on ellipsoids.
(LC_ALL): Set to C, since tzselect is English only. That way, we
treat decimal-points in -c option operands the same in all environments.
(usage): Document new options. Document existing ones better.
(output_distances): New variable.
(main): Don't assume SECSPERDAY <= INT_MAX here, since we try
not to assume that sort of thing elsewhere in this file.
Don't rely on undefined behavior in the weird case where
cuthitime < absolute_min_time + SECSPERDAY / 2.
This is a backwards-compatible way of transitioning to a less
politically-charged approach to choosing TZ values. A new time
zone table time.tab acts like zone.tab, except it omits TZ values
that are present only for political reasons. tzselect has a new
"-t zonetabtype" option that lets users select which time zone table
to use, and installers can select the default table. The zone.tab
file does not change, and the default tzselect table for now is
zone.tab. This avoids the backward-compatibility concerns
expressed on the tz mailing list; see, for example,
the discussion surrounding Derick Rethans's comments in
<http://mm.icann.org/pipermail/tz/2013-August/019544.html>
* .gitignore: Add time.tab.
* Makefile (ZONETABTYPE): New macro.
(TABDATA): Add time.tab.
(all): Depend on $(TABDATA).
(install): Do not depend on $(TABDATA), since $(DATA) includes it.
Install time.tab too.
(time.tab): New rule.
(tzselect.tab): Substitute ZONETABTYPE.
* zone-time.awk: New file.
* tzselect.8: Document new options, and --help and --version while
we're at it.
* tzselect.ksh (ZONETABTYPE): New var.
Implement -t ZONETABTYPE option.
Check that no extra operands are given.
* zone.tab: Change first comment line, to distinguish the two
tables better.
This unnecessary duplicate of America/Denver was confusing, as it
incorrectly implied that 'Mountain Time - Navajo' differed from
'Mountain Time' either now or in the past. Clarify this in a
better way, by mentioning in the Arizona entry that it doesn't
include Navajo.
On my platform (Ubuntu 13.04 x86-64, Xeon E3-1225 V2), this sped up
'zdump -V -c 2147483647,2147483648 America/Los_Angeles'
from 13.880 to 0.000 seconds user+system time.
(INTMAX_MAX): Define if the system doesn't.
(SECSPER400YEARS): New macro.
(SECSPER400YEARS_FITS): New constant.
(yeartot): Speed up by using division instead of
repeated subtraction.
* iso3166.tab, zone.tab: Make it clear that country codes aren't
necessarily for countries. Thanks to Derick Rethans for spotting this.
* zone.tab (Antarctica/McMurdo, Europe/Mariehamn, Europe/Sarajevo)
(America/St_Barthelemy, America/Kralendijk, Europe/Busingen)
(Europe/Guernsey, Europe/Zagreb, Europe/Isle_of_Man, Europe/Jersey)
(Europe/Podgorica, America/Marigot, Europe/Skopje, Europe/Ljubljana)
(Arctic/Longyearbyen, Europe/Bratislava, Europe/San_Marino)
(America/Lower_Princes, Europe/Vatican):
Undo recent changes, going back to the way these entries were done
in the last tz distribution. Only the Antarctica/South_Pole change
was retained.