summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-11 11:10:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-11 11:10:47 (GMT)
commit15b4eecc823345b12fb41a87076c06a93fffdebd (patch)
tree95f2f290f4447633c6e816454d96604787a659f8
parent4d51f6b054999c72115751f3895158195e42b40d (diff)
downloadtcl-15b4eecc823345b12fb41a87076c06a93fffdebd.zip
tcl-15b4eecc823345b12fb41a87076c06a93fffdebd.tar.gz
tcl-15b4eecc823345b12fb41a87076c06a93fffdebd.tar.bz2
Use "package provide Tcl" consistantly, in stead of either "package present Tcl" or "info tclversion"/"info patchlevel"
-rw-r--r--library/http/http.tcl2
-rw-r--r--library/tm.tcl4
-rw-r--r--tests/tm.test12
3 files changed, 9 insertions, 9 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl
index ac3b6d5..75898c9 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -1286,7 +1286,7 @@ proc http::Eof {token {force 0}} {
if {($state(coding) eq "gzip") && [string length $state(body)] > 0} {
if {[catch {
- if {[package vsatisfies [package present Tcl] 8.6]} {
+ if {[package vsatisfies [package provide Tcl] 8.6]} {
# The zlib integration into 8.6 includes proper gzip support
set state(body) [zlib gunzip $state(body)]
} else {
diff --git a/library/tm.tcl b/library/tm.tcl
index 40b8e40..bab5485 100644
--- a/library/tm.tcl
+++ b/library/tm.tcl
@@ -309,7 +309,7 @@ proc ::tcl::tm::UnknownHandler {original name args} {
proc ::tcl::tm::Defaults {} {
global env tcl_platform
- lassign [split [info tclversion] .] major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
set exe [file normalize [info nameofexecutable]]
# Note that we're using [::list], not [list] because [list] means
@@ -352,7 +352,7 @@ proc ::tcl::tm::Defaults {} {
# Calls 'path add' to paths to the list of module search paths.
proc ::tcl::tm::roots {paths} {
- regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
foreach pa $paths {
set p [file join $pa tcl$major]
for {set n $minor} {$n >= 0} {incr n -1} {
diff --git a/tests/tm.test b/tests/tm.test
index 3f93483..001b73e 100644
--- a/tests/tm.test
+++ b/tests/tm.test
@@ -6,7 +6,7 @@
# Copyright (c) 2004 by Donal K. Fellows.
# All rights reserved.
-package require Tcl 8.5
+package require Tcl 8.5-
if {"::tcltest" ni [namespace children]} {
package require tcltest 2
namespace import -force ::tcltest::*
@@ -19,12 +19,12 @@ test tm-1.1 {tm: path command exists} {
test tm-1.2 {tm: path command syntax} -returnCodes error -body {
::tcl::tm::path foo
} -result {unknown or ambiguous subcommand "foo": must be add, list, or remove}
-test tm-1.3 {tm: path command syntax} -returnCodes error -body {
+test tm-1.3 {tm: path command syntax} {
::tcl::tm::path add
-} -result "wrong # args: should be \"::tcl::tm::path add path ...\""
-test tm-1.4 {tm: path command syntax} -returnCodes error -body {
+} {}
+test tm-1.4 {tm: path command syntax} {
::tcl::tm::path remove
-} -result "wrong # args: should be \"::tcl::tm::path remove path ...\""
+} {}
test tm-1.5 {tm: path command syntax} -returnCodes error -body {
::tcl::tm::path list foobar
} -result "wrong # args: should be \"::tcl::tm::path list\""
@@ -200,7 +200,7 @@ test tm-3.11 {tm: module path management, remove ignores unknown path} -setup {
proc genpaths {base} {
# Normalizing picks up drive letters on windows [Bug 1053568]
set base [file normalize $base]
- lassign [split [package present Tcl] .] major minor
+ regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor
set results {}
set base [file join $base tcl$major]
lappend results [file join $base site-tcl]