1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-21 23:10:14 +00:00
Commit Graph

37 Commits

Author SHA1 Message Date
5ee6e8cbd1 tzselect: port to POSIX sh and fix a typo
* tzselect.ksh: Use portable names for trap signals.
Also, fix a typo: signal 2 (INT) was meant, not signal 12.
2015-05-27 10:11:50 -07:00
7d9279a766 tzselect: discard comments properly
The country code 'DM' matched data in the leading comments
in zone1970.tab, which caused tzselect to misbehave.
Problem reported by Owen Leibman in:
http://mm.icann.org/pipermail/tz/2015-May/022265.html
* tzselect.ksh (regions, TZ): Don't treat comments as data.
* NEWS: Mention this.
2015-05-11 21:50:27 -07:00
8f9ffd332b Better fix for tzselect in non-UTF-8 locales
* NEWS: Document this.
* tzselect.ksh (TZ_COUNTRY_TABLE, TZ_ZONE_TABLE):
If the current locale is not UTF-8, convert these tables
to the current locale's encoding before using them.
That's better than switching ths ehell to UTF-8, which
may not work if the current terminal doesn't support it.
Problem reported by Random832 in:
http://mm.icann.org/pipermail/tz/2015-May/022260.html
2015-05-03 23:53:32 -07:00
d772d0035a tzselect no longer mishandles '\', '-'
* tzselect.ksh (say): New shell function.
Use this instead of 'echo', so as not to mishandle
data containing '\' or leading '-'.
2015-05-03 23:53:32 -07:00
dae1928dcf tzselect now uses UTF-8 if available
* NEWS: Document this.
* tzselect.ksh (utf8_locale): New var.
Use it to select a UTF-8 locale if available.
2015-05-02 23:23:53 -07:00
276f85ddd2 tzselect: Display Posix TZ format when used 2014-11-26 11:34:32 -08:00
27bd92aec3 tzselect: Removed spaces in calls to awk-functions
Explanation:
GNU awk fails when a user-defined-functions is called with a space like in
'myUDF ()'. It does not fail when calling builtin functions, but removed
those spaces too.

Example code:
good_awk='function echo(x) { return x; } BEGIN { print echo("x"); }'
bad_awk_='function echo(x) { return x; } BEGIN { print echo ("x"); }'
sin_awk='BEGIN { print sin (0) }'

mawk -W version 2>/dev/null | head -n1
mawk "${sin_awk}"
mawk "${good_awk}"
mawk "${bad_awk_}"
gawk -V | head -n1
gawk "${sin_awk}"
gawk "${good_awk}"
gawk "${bad_awk_}"

Output:
mawk 1.3.4 20141027
0
x
x
GNU Awk 4.0.2
0
x
gawk: cmd. line:1: error: function `echo' called with space between name
and `(',
2014-11-25 12:02:44 -08:00
66cda43f67 tzselect: Fix for gawk treating '\.' as plain '.'
When using gawk and Posix TZ in tzselect, this warning is shown:
	awk: cmd. line:1: warning: escape sequence `\.' treated as plain `.'
gawk treats '\.' as '.'
mawk treats '\.' as '\.'
both treat '\\.' as '\\.'
The 2nd and 3rd are corrrect for 'Mm.w.d'.

Test:
gawk 'BEGIN{ date = "\."; print date }'
gawk 'BEGIN{ date = "\\."; print date }'
versus:
mawk 'BEGIN{ date = "\."; print date }'
mawk 'BEGIN{ date = "\\."; print date }'
* tzselect.ksh (date): Fix bug that broke POSIX TZ checking with gawk.
* NEWS: Document this.
2014-11-22 16:57:41 -08:00
62711791c3 tzselect: improve heuristic in Africa
Add the product of the longitude difference and the cosine of the
latitude farther from the equator to the distance measure.  This
works better for the Congolese test case noted by Alan Barrett in:
http://mm.icann.org/pipermail/tz/2014-July/021229.html
The new heuristic is not perfect, but no heuristic is.
* tzselect.ksh (abs, min): New functions
(convert_coord): Rename local to avoid name clash.
(gcdist): Rename from dist.
(pardist, dist): New functions.
* NEWS: Document this.
2014-08-11 18:41:32 -07:00
67d9b6ac6b * tzselect.ksh: Fix typo in implementation of undocumented -t option. 2014-08-11 17:13:25 -07:00
4c73ed617f Rename time.tab to zone1970.tab.
* Makefile (ZONETABLES): Rename from TIMETABLES.  All uses changed.
* zone1970.tab: Rename from time.tab.  All uses changed.
2014-07-31 15:20:45 -07:00
b7816e7306 * tzselect.ksh, NEWS: Port to non-Bash shell that has 'select'.
(Thanks to Alan Barrett.)
2014-07-22 20:18:49 -07:00
5ddc47fe41 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:31:54 -07:00
9a8aa790bc 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
0f9614ba9e * tzselect.ksh (doselect): Prompt to stderr, not stdout.
(Thanks to Patrick 'P. J.' McDermott.)
2013-10-06 12:28:30 -07:00
868ed00c10 tzselect: work around an old BusyBox awk bug
Patch by Patrick 'P. J.' McDermott in
<http://mm.icann.org/pipermail/tz/2013-October/020444.html>.
* tzselect.ksh: Replace awk -F options with FS assignments.
Before version 1.21.0, BusyBox awk didn't unescape the argument to
the -F option.  As a result, tzselect couldn't parse tables with
such versions of BusyBox awk.  See
<https://bugs.busybox.net/show_bug.cgi?id=5126> and
<http://git.busybox.net/busybox/commit?id=ea664dd>.
* NEWS: Document this.
2013-10-06 02:24:36 -07:00
be06aa48db tzselect: port to /bin/sh
Problem reported by Patrick 'P. J.' McDermott in
<http://mm.icann.org/pipermail/tz/2013-October/020441.html>.
This code is quite a bit different from what he proposed.
* tzselect.ksh: Rewrite so that it should work with /bin/sh on
common platforms.  For portability to Solaris 9 /bin/sh, use
`...`, not $(...), and avoid $((...)).
(doselect): New function.  Use this instead of plain 'select'.
Callers no longer need to worry whether it sets the var to empty.
* Makefile, NEWS: Document this.
2013-10-06 02:11:51 -07:00
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
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
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
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
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
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
a435f9f0ec Make bug-reporting address more configurable.
Based on a patch by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018452.html>.
* Makefile (BUGEMAIL): New macro.
(version.h, tzselect): Use it to define REPORT_BUGS_TO.
* tzselect.ksh (REPORT_BUGS_TO): New variable, used for --help.
* zdump.c, zic.c (usage): Use REPORT_BUGS_TO for --help.
2012-11-12 21:52:35 -08:00
89a60086d3 Output version info in a more-typical format.
E.g., "zic (tzcode) 2012i" instead of "tzcode2012i".
Thread started by Joseph S. Myers in
<http://mm.icann.org/pipermail/tz/2012-November/018439.html>.
* Makefile (PACKAGE): New macro.
(version.h, tzselect): New constant PKGVERSION, derived from PACKAGE.
(tzselect): TZVERSION is now simply VERSION, since PACKAGE is also
output.
* tzselect.ksh (PKGVERSION): New var, which Makefile substitutes for.
(--usage, --version): Exit with nonzero status if we can't
output the help or version number.
* tzselect.ksh (--version):
* zdump.c, zic.c (main):
Output versions like this: "zdump (tzcode) 2012i".
2012-11-09 18:12:22 -08:00
bd6e304281 Change email address to tz@iana.org.
* africa, australasia, europe, northamerica, southamerica:
* tzselect.ksh, zdump.c, zic.c:
In commentary and strings, change email address from
tz@elsie.nci.nih.gov to tz@iana.org, as the old email address
no longer works.
2012-11-09 17:49:36 -08:00
6daf83cd40 Have tzselect.ksh use Bash by default; this can be overridden.
* Makefile (KSHELL): New macro.
(tzselect): Use it.
* tzselect.ksh: Use "#!/bin/bash", not "#! /bin/ksh".  The Makefile
can override this.  No need for a space after "!'; that was put in
years ago only because of an urban legend.
2012-10-27 13:54:13 -07:00
33232258ad Use a single version number for both code and data.
* Makefile (VERSION): New macro, superseding ...
(TZCODE_VERSION, TZDATA_VERSION): Remove.  All uses changed.
(version.h): Call the variable TZVERSION, not TZCODE_VERSION.
All uses changed.
(tzselect): Interpolate TZVERSION, not TZCODE_VERSION.
(public): Adjust to new versioning scheme.
* tzselect.ksh (TZVERSION): Rename from TZCODE_VERSION.
* zdump.c, zic.c (main): Use TZVERSION, not TZCODE_VERSION.
2012-07-25 07:46:06 -07:00
dccd5a16af Switch from SCCS to git.
Remove the SCCS keyword '%W%' from all files.
Mostly this just remove comments.
Remove trailing white space, too.
* Makefile (TZCODE_VERSION): New macro.
(version.h): New rule.
(tzselect): Interpolate TZCODE_VERSION.
(clean): Remove version.h.
(zdump.o, zic.o): Depend on version.h.
* asctime.c, date.c, difftime.c, ialloc.c, localtime.c, scheck.c:
* strftime.c, zdump.c, zic.c: Remove elsieid.
* private.h: Remove privatehid.
* tzfile.h: Remove tzfilehid.
* tzselect.h (TZCODE_VERSION): Rename from VERSION.
* zdump.c, zic.c: Include "version.h",
and use TZCODE_VERSION instead of elsieid.
2012-07-18 17:30:38 -07:00
a2563cea80 --help and --version work
SCCS-file: tzselect.ksh
SCCS-SID: 8.2
2012-07-18 03:03:06 -04:00
ab5efb7df2 user@machine eliminated
SCCS-file: tzselect.ksh
SCCS-SID: 1.8
2012-07-18 03:02:49 -04:00
473db36254 SCCS ID
SCCS-file: tzselect.ksh
SCCS-SID: 1.7
2012-07-18 03:02:33 -04:00
dad12788f3 Eggert mods
SCCS-file: tzselect.ksh
SCCS-SID: 1.6
2012-07-18 03:02:33 -04:00
4c8839b376 Eggert mods
SCCS-file: tzselect.ksh
SCCS-SID: 1.5
2012-07-18 03:02:30 -04:00
5057b52b16 URL -> href
SCCS-file: tzselect.ksh
SCCS-SID: 1.4
2012-07-18 03:02:29 -04:00
79c773b3db Eggert mods
SCCS-file: tzselect.ksh
SCCS-SID: 1.3
2012-07-18 03:02:26 -04:00
c6ac6fc149 created
SCCS-file: tzselect.ksh
SCCS-SID: 1.1
2012-07-18 03:02:24 -04:00