Commit Graph
100 Commits
Author SHA1 Message Date
Paul Eggert 1d67c5bfca build: Makefile fixes; let user give AR and RANLIB; local libtz.a
* Makefile: Let the user override AR, and build libtz.a before
installing it, as suggested by Michael Forney in
<https://github.com/eggert/tz/pull/3>.  Also, let the user
override RANLIB.  Modernize a bit by assuming POSIX.2-1992 or
later; this is safe nowadays and simplifies the libtz.a business.
And treat 'leapseconds' more like we used to, since it's
machine-independent a 'make clean' doesn't need to remove it.
(TZLIB): Remove.
(AR, RANLIB): New macros.
(TABDATA): Add leapseconds, so that 'make' builds it by default.
(DATA): Remove leapseconds, since $(TABDATA) now has it.
(all): Depend on libtz.a, not $(LIBOBJS).
(install): Install libtz.a using 'cp', like other files.
Also invoke $(RANLIB) on it, after installing.
Do not assume that TZDIR is not overridden.
(install, INSTALL, check_time_t_alternatives): Use 'mkdir -p', as
it's safe to assume nowadays (standardized in POSIX.2-1992).
(install, INSTALL): Prefer 'cp -f' to 'rm' followed by 'cp', as
it's safe to assume 'cp -f' nowadays (also standardized in POSIX.2-1992).
(libtz.a): Rename from $(DESTDIR)$(TZLIB), since we now build it here.
Use $(AR) rather than ar.
Use $(RANLIB) rather than trying to guess it.
(clean_misc): Do not remove 'leapseconds', as it's machine-independent.
(maintainer-clean): Remove 'leapseconds' here instead.
(clean, check_public): Standardize on 'rm -fr' rather than 'rm -f -r';
formerly the makefile was inconsistent.
(set-timestamps.out): Don't ignore failurs of the actual touch command.
2013-10-02 10:48:46 -07:00
Paul Eggert 1479cad711 * Makefile (TZCSRCS, TZDSRCS, DATESRCS): Remove; unused.
* NEWS: Document recent Makefile fixes.
2013-10-01 21:54:42 -07:00
Paul Eggert 132e8351b6 * Makefile (TZDSRCS, TZDOBJS): Interchange asctime.c and asctime.o.
(Thanks to Andrew Paprocki.)
2013-10-01 21:45:25 -07:00
Paul Eggert 17ca83e6f8 doc: mention TC TIMEZONE's draft timezone service protocol
(Thanks to Mike Douglass.)
* tz-link.htm, NEWS: Add info about this.
2013-10-01 15:40:52 -07:00
Paul Eggert 320239cf81 Release tzcode2013g and tzdata2013g.
* NEWS, Makefile (VERSION): Increase to 2013g.
2013-09-30 21:10:49 -07:00
Paul Eggert 22fe30e600 zic: restore missing diagnostic with 'zic -v'
* zic.c (outzone): Restore diagnostic that was inadvertently
suppressed by the 2013-09-08 change to the 400-years-hack.
This doesn't affect zic's binary output; it affects only the
diagnostics generated by 'zic -v'.  The problem evinced itself
with Asia/Tehran, which currently should generate a diagnostic,
but doesn't without this patch.
* NEWS: Document the above.
2013-09-30 19:41:02 -07:00
Paul Eggert 0a6a92937f Morocco changed start-of-DST from March to April.
* africa (Morocco): The spring-forward date was moved too,
to the last Sunday in March.
* NEWS: Document this.
2013-09-30 09:01:01 -07:00
Paul Eggert 4b556f8dc8 * Makefile (check_public): When rebuilding, make $(ENCHILADA)
as well as 'all', so that the *.txt files are built.
2013-09-29 23:45:06 -07:00
Paul Eggert a070443b0c * africa (Morocco): Fix typos in comments. 2013-09-29 21:52:19 -07:00
Paul Eggert fce6e0c0bd * africa (Morocco): Adjust predicted transitions in 2036-7
to match GNU Emacs predictions for Ramadan.
2013-09-29 21:48:09 -07:00
Paul Eggert c074178903 * NEWS: Add thanks for the PD issue. 2013-09-29 21:30:51 -07:00
Paul Eggert 0def5ed0fd Morocco changed end-of-DST from September to October.
* africa (Morocco): Morocco now ends DST the last Sunday in
October, not September.  (Thanks to Steffen Thorsen.)
* NEWS: Document the above.
2013-09-29 21:30:30 -07:00
Paul Eggert 399f16a1ac * README: Clarify BSD text.
(Thanks to Philip Newton.)
2013-09-26 06:54:26 -07:00
Paul Eggert 7896da414f * private.h: Fix typo in comment.
(Thanks to Philip Newton.)
2013-09-26 06:52:15 -07:00
Paul Eggert dad4eed8a8 build: port to MinGW and fix symlink bugs
MinGW problem reported by Theo Veenker in
<http://mm.icann.org/pipermail/tz/2013-September/020378.html>.
The patched code should work even on POSIXish hosts
where 'link' and 'symlink' fail for whatever reason,
e.g., if the destination file system is VFAT.
Also, the patch fixes some bugs when symlinks are used.
* Makefile (CFLAGS): Mention HAVE_LINK in the comment.
(TZDSRCS): Add asctime.o, since MinGW lacks asctime.
(TZDOBJS): Add asctime.c.
* private.h (HAVE_LINK): Default to 1.
* zic.c (link) [!HAVE_LINK]: New macro.
(symlink) [!HAVE_SYMLINK]: New macro.
(dolink): Fix some bugs when 'link' fails but 'symlink' succeeds.
Fall back on copying when both fail.
* NEWS: Document the above.
2013-09-26 00:35:00 -07:00
Paul Eggert a5851f83d3 main: distribute leapseconds in tzdata, and fix timestamps
Problem with leapseconds reported by Matt Burgess in
<http://mm.icann.org/pipermail/tz/2013-September/020379.html>
with a followup by Ian Abbott in
<http://mm.icann.org/pipermail/tz/2013-September/020383.html>.
* Makefile (MANTXTS): New macro.
(maintainer-clean): Use it.
(DOCS): Add it.
(DATA): Add 'leapseconds'.
(LEAP_DEPS): New macro.
(leapseconds): Use it.
(public): Don't depend on set-timestamps; each tarball does that
individually now, to allow for more parallelization.
(date.1.txt, newctime.3.txt, newstrftime.3.txt, newtzset.3.txt)
(time2posix.3.txt, tzfile.5.txt, tzselect.8.txt, zdump.8.txt)
(zic.8.txt): Depend on the corresponding non-.txt file.
$(MANTXTS): New rule.
(set-timestamps.out): Rename from set-timestamps, and make it a file,
so that it has its own timestamp; this avoids useless rework.
Depend on $(ENCHILADA) and ignore files under Git that are not
also listed in $(ENCHILADA).  Set the timestamp of 'leapseconds'
and each $(MANTXTS) to be the maximum of its dependencies, to avoid
timestamp churn in future tarballs.  Prefer touch -m, as we don't
care about access time here.
(tzcode$(VERSION).tar.gz, tzdata$(VERSION).tar.gz):
Depend on set-timestamps.out rather than the individual files,
so timestamps are set before creating the tarballs even when
make is parallelized.
(tzcode$(VERSION).tar.gz): Don't mention *.[1-8].txt explicitly,
since we now get $(MANTXTS) via $(DOCS).
* NEWS: Document the above.
2013-09-25 15:50:44 -07:00
Paul Eggert ca267f2db1 doc: document public-domain status of files, and streamline README
* Makefile (COMMON): Move README here ...
(DOCS): ... from here, as it talks about the public-domain status
of the files, and this should be in both tarballs.
* README: Add intro.  Mention public-domain status of files.
Remove and reorganize some obsolete text, e.g., move 1989 release
info from here to NEWS's tail.
* NEWS: Document the above.
2013-09-25 13:16:49 -07:00
Paul Eggert 7436d74387 Release tzcode2013f and tzdata2013f.
* NEWS, Makefile (VERSION): Increase to 2013f.
2013-09-24 23:42:08 -07:00
Paul Eggert 6e770de058 Port to x32 by fixing type incompatibility with POSIX.
Reported by Elliott Hughes in
<http://mm.icann.org/pipermail/tz/2013-September/020376.html>.
* localtime.c (timezone) [USG_COMPAT]:
(altzone) [ALTZONE]: Now long, not time_t.
* strftime.c (_fmt): Use long, not int, to store timezone.
* NEWS: Document this.
2013-09-24 18:42:34 -07:00
Paul Eggert e28afbbac3 * asia (Palestine): Autumn transition is now at 00:00, not 01:00.
(Thanks to Steffen Thorsen.)
* NEWS: Document this.
2013-09-24 12:02:25 -07:00
Paul Eggert 13c1a17683 * NEWS: Mention mawk bug and workaround. 2013-09-24 11:41:53 -07:00
Paul Eggert 464a055adf * leapseconds.awk: Avoid long string literals.
This works around an Awk bug in Ubuntu 12.04 LTS, 32 bits,
reported by Cyril Baurand in
<http://mm.icann.org/pipermail/tz/2013-September/020370.html>
2013-09-24 08:54:39 -07:00
Paul Eggert 8ea4850bf6 dist: 'make set-timestamps' cleanup
* Makefile (set-timestamps): Use git's tformat rather than format,
to port to strict POSIX hosts where `` output in shell scripts
cannot end in a non-newline.  Use git diff --quiet rather than git
diff --name-only, as it's simpler.  Use touch -c for safety, and
-m to avoid setting last-access time, which we don't care about.
Diagnose files that don't match repository.
* NEWS: Document this.
2013-09-23 10:58:56 -07:00
Paul Eggert bdf636b211 * NEWS: Mention self and git tags. 2013-09-23 00:10:57 -07:00
Paul Eggert 928fb7ab7e * NEWS: Update release dates slightly; use "-", not "+" to connect. 2013-09-23 00:00:49 -07:00
Paul Eggert e6033febb1 * Makefile (DOCS): Add NEWS. 2013-09-21 16:26:59 -07:00
Paul Eggert e5e86decb9 * NEWS: New file. 2013-09-21 16:25:14 -07:00
Paul Eggert 69f943797b * southamerica (Para): Paraguayan law specifies no transition time.
Mention this in a comment.  Thanks to Waldemar Villamayor-Venialbo in
<http://mm.icann.org/pipermail/tz/2013-September/020327.html>.
2013-09-21 09:09:24 -07:00
Paul Eggert 5250212e82 * asia (Jordan, Asia/Amman): Guess that Jordan's change is permanent. 2013-09-21 08:54:30 -07:00
Paul Eggert ba0a5b4708 * newtzset.3: Capitalize more consistently. 2013-09-21 08:35:26 -07:00
Paul Eggert 1eda0f6cd4 Tocantins won't observe DST this spring.
Thanks to Steffen Thorsen in
<http://mm.icann.org/pipermail/tz/2013-September/020311.html>.
* southamerica (America/Araguaina): No longer observing DST.
2013-09-20 09:58:15 -07:00
Paul Eggert db6270a00d Release tzcode2013e and tzdata2013e.
* Makefile (VERSION): Increase to 2013e.
2013-09-19 23:50:04 -07:00
Paul Eggert b8e081b8ba * europe (Europe/Vaduz): Add confirming commentary from Alois Treindl. 2013-09-18 10:39:29 -07:00
Paul Eggert 738ad89a82 * zic.c: Output version-2 format files if possible.
We don't know of any clients where this makes a difference, but it
is a more-conservative change, as in theory older clients could
reject version-3 format files merely because of the version number.
(ZIC_VERSION_PRE_2013): New macro.
(writezone): New arg 'version'.  All callers changed.
(outzone): Output version-2 format files unless the capabilities
of version 3 are used.
2013-09-15 23:22:33 -05:00
Paul Eggert 9ae173df4c * zic.8: "any number of" -> "one or more" white space chars.
Problem reported by Michael Deckers in
<http://mm.icann.org/pipermail/tz/2013-September/020206.html>.
2013-09-15 23:17:45 -05:00
Paul Eggert ce93b2490f * tzfile.5 (SEE ALSO): Mention zdump(8), zic(8). 2013-09-15 23:15:13 -05:00
Paul Eggert a48e137422 * Theory: Fix typos noted by Philip Newton
in <http://mm.icann.org/pipermail/tz/2013-September/020197.html>.
2013-09-15 18:36:34 -05:00
Paul Eggert 9d3b5229ca * Theory (Accuracy of the tz database): New section.
It contains material moved here from other sections, along
with material taken from my recent emails to the tz mailing list.
Suggested by Zefram in
<http://mm.icann.org/pipermail/tz/2013-September/019863.html>.
2013-09-14 22:28:37 -07:00
Paul Eggert 4a0d6bb036 * europe: Fix comment misspelling in previous change. 2013-09-11 20:42:25 -07:00
Paul Eggert 9805c5c4a3 * europe, zic.8 (Europe/Zurich): Change transition to 1853-07-16.
Explain how I derived this guess from Messerli's book.
Also, give better evidence about the 1894 transition,
from Pierre-Yves Berger.
2013-09-11 18:28:36 -07:00
Paul Eggert 09f994d25d * europe, zic.8: Correct Bern Mean Time to 0:29:46.
Reported by Alois Treindl in
<http://mm.icann.org/pipermail/tz/2013-September/020139.html>.
2013-09-11 09:17:03 -07:00
Paul Eggert a46793a95b Revert the change that added meta-information to version-3 format.
Further testing found that it was incompatible with Ubuntu 12.04 glibc
so this feature requires redesign and more testing.
* Makefile (ZFLAGS): Remove comment about name and version info.
Make it an empty var instead.
* tzfile.5, tzfile.h: Remove description of meta-information.
* zic.8: Remove options -n and -o.
* zic.c: Don't include <stddef.h>.
(genoption, genoptions, genname, addgenoption, writevalue): Remove.
(usage, main, writezone): Remove support for -n and -o.
2013-09-11 02:42:07 -07:00
Paul Eggert 2022cddf08 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
Paul Eggert fe717b16cc * zic.8 (EXTENDED EXAMPLE): Adjust to match what's in 'europe' now.
Reported by Alois Treindl in
<http://mm.icann.org/pipermail/tz/2011-August/008722.html>.
2013-09-11 01:54:41 -07:00
Paul Eggert 2e053b5600 Remove -t ZONETABTYPE option from 'tzselect'.
This was experimental, and it appears that the tzwinnow
approach will be better.  We need to cut a new stable
release soon, and the -t option might make it harder to
integrate tzwinnow later, so let's omit -t for now.
* .gitignore: Remove time.tab.
* Makefile (ZONETABTYPE): Remove.  All uses removed.
(time.tab): Remove.  All uses removed.
* Theory: Omit discussion of time.tab.
* zone-time.awk: Remove.
* tzselect.8: Omit -t and time.tab.
* tzselect.ksh (ZONETABTYPE): Remove.  All uses removed.
Remove -t ZONETABTYPE option.
* zone.tab: Restore first comment line, since there's no longer
a need to distinguish this file from time.tab.
2013-09-10 17:47:17 -07:00
Paul Eggert 8dada0cec8 * tzfile.h: Fix tzfile.h comment.
Spelling problem reported by Nathan Stratton Treadway in
<http://mm.icann.org/pipermail/tz/2013-September/020121.html>.
2013-09-10 13:15:22 -07:00
Paul Eggert fe2db73d5f Improve tzfile format as suggested by Zefram and Alan Barrett.
* tzfile.5: Be a bit more careful about wording for integers.
Use binary terminators for the byte strings, not newlines.
Add a size field.  Terminate by another NUL.  Mention where
future extensions are expected to go.
* zic.c (writezone): Implement this.
(addgenoption): Omit namelen check; no longer needed.
(writevalue): Remove.
2013-09-10 12:49:45 -07:00
Paul Eggert 14333b7db8 build: support DESTDIR
* Makefile (install, INSTALL, posix_only, right_only, right_posix)
(posix_right, $(DESTDIR)$(TZLIB)): Add DESTDIR support.
Modified from a suggestion by Volker Zell in
<http://mm.icann.org/pipermail/tz/2013-September/020058.html>.
2013-09-09 23:58:03 -07:00
Paul Eggert d74d5b9500 * tzfile.5: Repeat the TZ string after the name-value pairs.
Suggested by Arthur David Olson in
<http://mm.icann.org/pipermail/tz/2013-September/020100.html>.
* zic.c (writezone): Implement this.
2013-09-09 22:32:56 -07:00
Paul Eggert 147ea0873b * europe (Europe/Zurich): Move 1848 transition to 1855. 2013-09-09 21:49:20 -07:00
Paul Eggert d7680ffd3d Add optional meta-information to version-3 format.
* 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.
2013-09-09 17:16:37 -07:00
Paul Eggert 8ee0fbebc6 Reflect Fiji DST change planned for October.
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.
2013-09-09 12:39:51 -07:00
Paul Eggert db9a9e1fe8 * europe (Europe/Vaduz): Now a link to Europe/Zurich.
This is more likely to be correct.
2013-09-09 11:50:29 -07:00
Paul Eggert f8e80af5fc Replace a zone with a link when that doesn't lose non-LMT info.
* africa (Africa/Juba): Now a link to Africa/Khartoum.
2013-09-09 11:49:02 -07:00
Paul Eggert 82563b54ca Fix off-by-one bug with Kingston Mean Time.
* 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.
2013-09-09 11:38:05 -07:00
Paul Eggert cd270af158 * zic.c: Tweak 400-years-hack to better handle some edge cases better.
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.
2013-09-08 23:53:35 -07:00
Paul Eggert 27c15f3625 Bump tzfile format to version 3.
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.
2013-09-08 23:04:07 -07:00
Paul Eggert d7d8679c08 * zic.c: Prefer <stdarg.h> to allocating memory by hand.
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.
2013-09-08 21:48:01 -07:00
Paul Eggert 30364485a6 Improve the support for perpetual DST.
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".
2013-09-08 19:16:32 -07:00
Paul Eggert 019082fd45 * zic.c (stringzone): Add support for perpetual DST.
This causes zic to generate, e.g., TZ='WART4WARST,J1/0,J365/24'
for perpetual DST in San Luis, Argentina.
See <http://mm.icann.org/pipermail/tz/2013-September/020056.html>.
2013-09-06 18:56:00 -07:00
Paul Eggert 07351e0248 Support time stamps past 2038 in zones like America/Santiago.
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.
2013-09-05 18:28:08 -07:00
Paul Eggert bd3e920d0e Record that San Luis is at UTC-3, not UTC-4 with perpetual UTC.
* 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.
2013-09-05 13:22:54 -07:00
Paul Eggert 0aaf939698 * tz-link.htm (href): Update shapefile citations.
Reported by Guy Harris in
<http://mm.icann.org/pipermail/tz/2013-September/019974.html>.
2013-09-05 11:45:20 -07:00
Paul Eggert f1234d5dd5 * newctime.3: Fix typos reported by Paul Goyette. 2013-09-05 08:17:41 -07:00
Paul Eggert b9fe626167 * Theory: Say that excluding 'backward' should not affect other data.
Suggested by Stephen Colebourne in
<http://mm.icann.org/pipermail/tz/2013-September/019939.html>.
2013-09-05 07:46:03 -07:00
Paul Eggert 0729dfdfa0 * newtzset.3: Fix misspelling of "newctime" in previous patch. 2013-09-05 07:07:58 -07:00
Paul Eggert 10a38b7ee2 * newctime.3, newstrftime.3, newtzset.3, zdump.8: Explain UT vs UTC better.
Suggested by Steve Allen in
<http://mm.icann.org/pipermail/tz/2013-September/019924.html>.
2013-09-05 07:03:28 -07:00
Paul Eggert 42801d2b1f Correct some UTC-vs-UT solecisms.
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.
2013-09-04 19:07:31 -07:00
Paul Eggert 3d046bc0e4 * Theory: Suggest at least one name per inhabited country or territory.
From a suggestion by Stephen Colebourne in
<http://mm.icann.org/pipermail/tz/2013-September/019868.html>.
2013-09-04 17:42:56 -07:00
Paul Eggert f636932933 Document some longstanding unwritten guidelines.
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.
2013-09-03 16:51:22 -07:00
Paul Eggert 33edc00168 * australasia (Pacific/Johnston): Now a link to Pacific/Honolulu.
The old, standalone entry was demonstrably wrong, and the link
is more nearly right.  Problem reported by Andrew Main (Zefram) in
<http://mm.icann.org/pipermail/tz/2013-September/019817.html>.
2013-09-03 00:28:14 -07:00
Paul Eggert c7bc2f8e1a Replace some zones with links when that doesn't lose non-LMT info.
* 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.
2013-09-02 23:33:25 -07:00
Paul Eggert c8f960ec72 * backward: Move some links back to primary files.
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.
2013-09-02 08:09:06 -07:00
Paul Eggert 614b193e52 * Theory: Improve citation to Morrison & Stephenson.
Mention the 1972 UTC transition.  See Steve Allen in
<http://mm.icann.org/pipermail/tz/2013-September/019770.html>.
2013-09-02 01:51:15 -07:00
Paul Eggert 28cf16f575 * Theory: Describe LMT, cutoffs, zone.tab, and time.tab better.
Following discussion by Lester Caine in
<http://mm.icann.org/pipermail/tz/2013-August/019716.html>
and Garrett Wollman in
<http://mm.icann.org/pipermail/tz/2013-August/019715.html>.
2013-08-31 04:20:31 -07:00
Paul Eggert 5e8489b16d * Theory: Describe LMT better.
Following a suggestion by Guy Harris in
<http://mm.icann.org/pipermail/tz/2013-August/019706.html>.
2013-08-30 16:43:57 -07:00
Paul Eggert 242980fc79 Revert recent pre-1970 changes.
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.
2013-08-30 16:36:21 -07:00
Paul Eggert 3526093c71 New file 'pre1970' for zones that differ only in pre-1970 time stamps.
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.
2013-08-30 01:07:05 -07:00
Paul Eggert 46441ef0c1 * iso3166.tab (BQ): Change common name to "Caribbean Netherlands".
This appears to be a more common name in English for this newish
political region; for example, see
<http://en.wikipedia.org/wiki/Caribbean_Netherlands>.
2013-08-26 10:13:40 -07:00
Paul Eggert 45dcf69b45 Move obsolescent Montreal entry to 'backward'.
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.
2013-08-26 10:13:40 -07:00
Paul Eggert 9432f1d23d Move obsolescent Americas entries to 'backward'.
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.
2013-08-26 10:13:40 -07:00
Paul Eggert 81be53c16b northamerica: move America/Shiprock to 'backward'
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.
2013-08-26 10:13:40 -07:00
Paul Eggert 943a662186 * localtime.c: Fix another integer overflow bug in mktime.
(time2sub): Avoid undefined behavior on time_t overflow.
Reported by Elliott Hughes in
<http://mm.icann.org/pipermail/tz/2013-August/019580.html>.
2013-08-22 12:47:51 -07:00
Paul Eggert c61cedc1d0 * .gitignore: Add 'date'. 2013-08-22 12:24:31 -07:00
Paul Eggert c20dd1949f * tzselect.ksh (usage): Improve -c description.
Suggested by Alan Barrett in
<http://mm.icann.org/pipermail/tz/2013-August/019578.html>.
2013-08-22 06:33:38 -07:00
Paul Eggert e43fc49697 tzselect: -c COORD now supports more ISO 6709 forms
* 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.
2013-08-20 20:22:07 -07:00
Paul Eggert b383bf6b67 * tzselect.ksh: Compute list of continents from the time zone table,
so that 'tzselect -t time' doesn't create a blind alley for the Arctic.
2013-08-20 12:00:07 -07:00
Paul Eggert ebdf0c5d0c tzselect: new options -c COORD and -n LIMIT
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.
2013-08-20 00:57:59 -07:00
Paul Eggert 98cf55b78e * date.c (nondigit): Add ATTRIBUTE_PURE, to pacify GCC 4.8.1. 2013-08-16 22:02:27 -07:00
Paul Eggert e0d4fb5f1e * zdump.c: Minor integer-size porting fixes.
(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.
2013-08-16 21:53:37 -07:00
Paul Eggert a52dc74e57 Fix misspelling in previous change. 2013-08-16 12:27:16 -07:00
Paul Eggert cc3f93886b Add -t ZONETABTYPE option to 'tzselect'.
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.
2013-08-16 12:19:42 -07:00
Paul Eggert d58b59dd8a * zone.tab (America/Shiprock): Remove.
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.
2013-08-15 17:46:10 -07:00
Paul Eggert ecb109b11d Further removal of attempt to support floating-point time_t.
* localtime.c (timesub):
* zdump.c (my_localtime): Don't worry about time_t being floating-point.
* localtime.c (timesub): Avoid undefined behavior on integer
overflow when assigning time_t to int.
2013-08-15 14:31:51 -07:00
Paul Eggert 71b6c1b210 * zdump.c: Tune performance of -c with large numbers on 64-bit hosts.
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.
2013-08-15 00:30:21 -07:00
Paul Eggert ee40570d7d Revert most of the recent zone.tab changes.
* 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.
2013-08-14 12:14:23 -07:00
Paul Eggert 3e53972ea4 * .gitignore: Add 'leapseconds'.
This follows up on the previous change, since 'leapseconds'
is now generated automatically.
2013-08-14 11:58:03 -07:00
Paul Eggert 459b72d3ed Generate the 'leapseconds' file automatically from leap-seconds.list.
* leap-seconds.list: New file, copied from the NIST.
* leapseconds: Remove from git; it's now generated.
* leapseconds.awk: New file.
* Makefile (DATA): Add leap-seconds.list.  Remove leapseconds.
(MISC): Add leapseconds.awk.
(leapseconds): New rule.
(right_posix, posix_right): Depend on leapseconds.
(clean_misc): Remove leapseconds.
2013-08-12 23:58:29 -07:00
Paul Eggert 3cfb933344 Remove attempt to support floating-point time_t.
It wasn't tested and probably never worked, no platform used it,
and the latest POSIX no longer allows it.
* Makefile (typecheck): Don't check time_t being 'double'.
* Theory: Document the change.
* difftime.c (difftime):
* localtime.c (differ_by_repeat, tzload, timesub, time2sub):
* private.h (time_t_min, time_t_max):
* zdump.c (absolute_min_time, absolute_max_time, tformat):
Don't try to support floating-point time_t.
* localtime.c, private.h, zdump.c: Don't include float.h.
* localtime.c (truncate_time, double_to_time):
* private.h (TYPE_INTEGRAL):
* zdump.c (checkabsolutes):
Remove; no longer needed.  All uses removed.
* zdump.8 (LIMITATIONS): Remove discussion of floating-point time_t.
2013-08-12 01:41:34 -07:00
Paul Eggert 4e5dbe1bbf Use symbolic links to deduplicate installed files.
* Makefile (TZDIR_BASENAME): New macro.
(TZDIR): Use it.
(other_two): Remove.
(right_posix, posix_right): Use a symbolic link if supported.
This saves about 2 megabytes' worth of installed files.
2013-08-11 10:14:18 -07:00