From da6099c4aee8ad8a537e6dc5354e8bbe32913dac Mon Sep 17 00:00:00 2001 From: max Date: Tue, 18 Oct 2011 13:03:42 +0000 Subject: Don't cache the system timezone when it was derived from TCL_TZ or TZ. --- ChangeLog | 7 +++++++ library/clock.tcl | 27 ++++++++++++++++----------- tests/clock.test | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cc8e66..50c81b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-18 Reinhard Max + + * library/clock.tcl (::tcl::clock::GetSystemTimeZone): Cache the + time zone only if it was detected by one of the expensive + methods. Otherwise after unsetting TCL_TZ or TZ the previous value + will still be used. + 2011-10-15 Venkat Iyer * library/tzdata/America/Sitka : Update to Olson's tzdata2011l * library/tzdata/Pacific/Fiji diff --git a/library/clock.tcl b/library/clock.tcl index 8bce49f..2e9cae7 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -3076,18 +3076,23 @@ proc ::tcl::clock::GetSystemTimeZone {} { set timezone $result } elseif {[set result [getenv TZ]] ne {}} { set timezone $result - } elseif { [info exists CachedSystemTimeZone] } { - set timezone $CachedSystemTimeZone - } elseif { $::tcl_platform(platform) eq {windows} } { - set timezone [GuessWindowsTimeZone] - } elseif { [file exists /etc/localtime] - && ![catch {ReadZoneinfoFile \ - Tcl/Localtime /etc/localtime}] } { - set timezone :Tcl/Localtime - } else { - set timezone :localtime } - set CachedSystemTimeZone $timezone + if {![info exists timezone]} { + # Cache the time zone only if it was detected by one of the + # expensive methods. + if { [info exists CachedSystemTimeZone] } { + set timezone $CachedSystemTimeZone + } elseif { $::tcl_platform(platform) eq {windows} } { + set timezone [GuessWindowsTimeZone] + } elseif { [file exists /etc/localtime] + && ![catch {ReadZoneinfoFile \ + Tcl/Localtime /etc/localtime}] } { + set timezone :Tcl/Localtime + } else { + set timezone :localtime + } + set CachedSystemTimeZone $timezone + } if { ![dict exists $TimeZoneBad $timezone] } { dict set TimeZoneBad $timezone [catch {SetupTimeZone $timezone}] } diff --git a/tests/clock.test b/tests/clock.test index 7937933..917543a 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -35895,6 +35895,39 @@ test clock-38.1 {regression - convertUTCToLocalViaC - east of Greenwich} \ } \ -result {01:00:00} +test clock-38.2 {make sure TZ is not cached after unset} \ + -setup { + if { [info exists env(TZ)] } { + set oldTZ $env(TZ) + unset env(TZ) + } + if { [info exists env(TCL_TZ)] } { + set oldTCLTZ $env(TCL_TZ) + unset env(TCL_TZ) + } + } \ + -body { + set t1 [clock format 0] + # a time zone that is unlikely to anywhere + set env(TZ) "+04:20" + set t2 [clock format 0] + unset env(TZ) + set t3 [clock format 0] + expr {$t1 eq $t3 && $t1 ne $t2} + } \ + -cleanup { + if { [info exists oldTZ] } { + set env(TZ) $oldTZ + unset oldTZ + } + if { [info exists oldTclTZ] } { + set env(TCL_TZ) $oldTclTZ + unset oldTclTZ + } + } \ + -result 1 + + test clock-39.1 {regression - synonym timezones} { clock format 0 -format {%H:%M:%S} -timezone :US/Eastern } {19:00:00} -- cgit v0.12 From 23e62f2f9aa1b9bd55cdd951a6e822383da52f95 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 20 Oct 2011 15:32:58 +0000 Subject: Update changes toward 8.5.11 release. Bump to http 2.7.7. --- ChangeLog | 9 +++++++++ changes | 35 +++++++++++++++++++++++++++++++++++ library/http/http.tcl | 2 +- library/http/pkgIndex.tcl | 2 +- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 6 files changed, 50 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50c81b9..06b562b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-10-20 Don Porter + + * library/http/http.tcl: Bump to version 2.7.7 + * library/http/pkgIndex.tcl: + * unix/Makefile.in: + * win/Makefile.in: + + * changes: Updates for 8.5.11 release. + 2011-10-18 Reinhard Max * library/clock.tcl (::tcl::clock::GetSystemTimeZone): Cache the diff --git a/changes b/changes index 23efc47..e9823d2 100644 --- a/changes +++ b/changes @@ -7545,3 +7545,38 @@ memory with buffer backup (ferrieux) => platform 1.0.10 --- Released 8.5.10, June 23, 2011 --- See ChangeLog for details --- + +2011-07-02 (bug fix)[3349507] correct double(1[string repeat 0 23]) (kenny) + +2011-07-19 (bug fix)[3371644] Tcl_ConvertElement() segfault (sader, ferrieux) + +2011-07-21 (bug fix)[3372130] hypot(.) segfault (nijtmans) + +2011-08-12 (bug fix)[3389764] memleaks due to reference cycles in dup'd paths + +2011-08-15 (bug fix)[3390272] leak of [info script] value (porter) + +2011-08-17 (bug fix)[3393150] bignum leaks in Tcl_Get*() routines (porter) + +2011-08-18 (bug fix)[3393714] [string toupper] overflow (nijtmans) + +2011-08-30 (bug fix)[3398794] panic in interp limit setting (gavlian,fellows) + +2011-09-08 (bug fix)[3401704] revised expr parser to permit function names +like "nano()" instead of parsing as "nan o()" with missing op (duquette,porter) + *** POTENTIAL INCOMPATIBILITY *** + +2011-09-13 (bug fix)[3390638] solaris studio cc workaround (kechel,porter) + +2011-09-13 (bug fix)[3405652] DTrace workaround (michelson,porter) + +2011-09-16 (bug fix)[3391977] -headers overrides -type (ziegenhagen,fellows) +=> http 2.7.7 + +2011-09-16 (bug fix)[3400658] wrong num args msg with TclOO (rsooltan,fellows) + +2011-10-11 (bug fix)[2935503] [file stat] returns bad mode (nadkarni,nijtmans) + +2011-10-15 tzdata updated to Olson's tzdata2011l (iyer) + +--- Released 8.5.11, November 1, 2011 --- See ChangeLog for details --- diff --git a/library/http/http.tcl b/library/http/http.tcl index 1c2b182..9c2d43d 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -11,7 +11,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles -package provide http 2.7.6 +package provide http 2.7.7 namespace eval http { # Allow resourcing to not clobber existing data diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index fed5829..168d628 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,4 +1,4 @@ # Tcl package index file, version 1.1 if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.7.6 [list tclPkgSetup $dir http 2.7.6 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.7.7 [list tclPkgSetup $dir http 2.7.7 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/unix/Makefile.in b/unix/Makefile.in index ded4c6b..2238f1c 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -773,8 +773,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \ done; - @echo "Installing package http 2.7.6 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.6.tm; + @echo "Installing package http 2.7.7 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.7.tm; @echo "Installing library opt0.4 directory"; @for i in $(TOP_DIR)/library/opt/*.tcl ; \ do \ diff --git a/win/Makefile.in b/win/Makefile.in index 8883128..af9e0a5 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -639,8 +639,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/http1.0"; \ done; - @echo "Installing package http 2.7.6 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.6.tm; + @echo "Installing package http 2.7.7 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.7.tm; @echo "Installing library opt0.4 directory"; @for j in $(ROOT_DIR)/library/opt/*.tcl; \ do \ -- cgit v0.12