summaryrefslogtreecommitdiffstats
path: root/tools/tclZIC.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tclZIC.tcl')
-rwxr-xr-xtools/tclZIC.tcl24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/tclZIC.tcl b/tools/tclZIC.tcl
index b3dd667..1b19d82 100755
--- a/tools/tclZIC.tcl
+++ b/tools/tclZIC.tcl
@@ -3,14 +3,14 @@
# tclZIC.tcl --
#
# Take the time zone data source files from Arthur Olson's
-# repository at https://www.iana.org/time-zones, and prepare time zone
+# repository at elsie.nci.nih.gov, and prepare time zone
# information files for Tcl.
#
# Usage:
# tclsh tclZIC.tcl inputDir outputDir
#
# Parameters:
-# inputDir - Directory (e.g., tzdata2022a) where Olson's source
+# inputDir - Directory (e.g., tzdata2003e) where Olson's source
# files are to be found.
# outputDir - Directory (e.g., ../library/tzdata) where
# the time zone information files are to be placed.
@@ -25,18 +25,20 @@
#
#----------------------------------------------------------------------
#
-# Copyright © 2004 Kevin B. Kenny. All rights reserved.
+# Copyright (c) 2004 by Kevin B. Kenny. All rights reserved.
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#----------------------------------------------------------------------
+package require Tcl 8.5
+
# Define the names of the Olson files that we need to load.
# We avoid the solar time files and the leap seconds.
set olsonFiles {
africa antarctica asia australasia
backward etcetera europe northamerica
- southamerica
+ pacificnew southamerica systemv
}
# Define the year at which the DST information will stop.
@@ -356,7 +358,7 @@ proc parseON {on} {
# third possibility - lastWeekday - field 5
last([[:alpha:]]+)
)$
- } $on -> dom1 wday2 dir2 num2 wday3]} {
+ } $on -> dom1 wday2 dir2 num2 wday3]} then {
error "can't parse ON field \"$on\""
}
if {$dom1 ne ""} {
@@ -507,7 +509,7 @@ proc parseTOD {tod} {
(?:
([wsugz]) # field 4 - type indicator
)?
- } $tod -> hour minute second ind]} {
+ } $tod -> hour minute second ind]} then {
puts stderr "$fileName:$lno:can't parse time field \"$tod\""
incr errorCount
}
@@ -556,7 +558,7 @@ proc parseOffsetTime {offset} {
:([[:digit:]]{2}) # field 4 - second
)?
)?
- } $offset -> signum hour minute second]} {
+ } $offset -> signum hour minute second]} then {
puts stderr "$fileName:$lno:can't parse offset time \"$offset\""
incr errorCount
}
@@ -938,7 +940,7 @@ proc applyRules {ruleSet year startSecs stdGMTOffset DSTOffset nextGMTOffset
if {
$earliestSecs > $startSecs &&
($until eq "" || $earliestSecs < $untilSecs)
- } {
+ } then {
# Test if the initial transition has been done.
# If not, do it now.
@@ -987,7 +989,7 @@ proc applyRules {ruleSet year startSecs stdGMTOffset DSTOffset nextGMTOffset
set date [::tcl::clock::GetJulianDayFromEraYearMonthDay \
[dict create era CE year $year month 1 dayOfMonth 1] 2361222]
set startSecs [expr {
- [dict get $date julianDay] * wide(86400) - 210866803200
+ [dict get $date julianDay] * wide(86400) - 210866803200
- $stdGMTOffset - $DSTOffset
}]
@@ -1263,7 +1265,7 @@ proc writeZones {outDir} {
# Write the data to the information file
set f [open $fileName w]
- fconfigure $f -translation lf -encoding utf-8
+ fconfigure $f -translation lf
puts $f "\# created by $::argv0 - do not edit"
puts $f ""
puts $f [list set TZData(:$zoneName) $data]
@@ -1316,7 +1318,7 @@ proc writeLinks {outDir} {
# Write the file
set f [open $fileName w]
- fconfigure $f -translation lf -encoding utf-8
+ fconfigure $f -translation lf
puts $f "\# created by $::argv0 - do not edit"
puts $f $ifCmd
puts $f $setCmd