summaryrefslogtreecommitdiffstats
path: root/library/package.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-07-23 04:12:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-07-23 04:12:46 (GMT)
commit7bc20e13c9c5f3706c7f50ae52ff329de08f8782 (patch)
tree4d2d9275d5243ea9e69abc3b325fce1875cda4bd /library/package.tcl
parent6f173b7f6fa783afed059c46c49241bebb0995b7 (diff)
downloadtcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.zip
tcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.tar.gz
tcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.tar.bz2
* library/auto.tcl: Updates to the Tcl script library to make
* library/history.tcl: use of Tcl 8.4 features. Forward port of * library/init.tcl: appropriate portions of [Patch 1237755]. * library/package.tcl: * library/safe.tcl: * library/word.tcl:
Diffstat (limited to 'library/package.tcl')
-rw-r--r--library/package.tcl26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/package.tcl b/library/package.tcl
index 7c4e4e9..9d9e0a9 100644
--- a/library/package.tcl
+++ b/library/package.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl which can be loaded on demand
# for package management.
#
-# RCS: @(#) $Id: package.tcl,v 1.32 2004/08/02 22:01:38 dgp Exp $
+# RCS: @(#) $Id: package.tcl,v 1.33 2005/07/23 04:12:49 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -31,8 +31,8 @@ namespace eval tcl::Pkg {}
proc tcl::Pkg::CompareExtension { fileName {ext {}} } {
global tcl_platform
- if {![string length $ext]} {set ext [info sharedlibextension]}
- if {[string equal $tcl_platform(platform) "windows"]} {
+ if {$ext eq ""} {set ext [info sharedlibextension]}
+ if {$tcl_platform(platform) eq "windows"} {
return [string equal -nocase [file extension $fileName] $ext]
} else {
# Some unices add trailing numbers after the .so, so
@@ -40,7 +40,7 @@ proc tcl::Pkg::CompareExtension { fileName {ext {}} } {
set root $fileName
while {1} {
set currExt [file extension $root]
- if {[string equal $currExt $ext]} {
+ if {$currExt eq $ext} {
return 1
}
@@ -135,7 +135,7 @@ proc pkg_mkIndex {args} {
}
if {[catch {
- glob -directory $dir -tails -types {r f} {expand}$patternList
+ glob -directory $dir -tails -types {r f} -- {expand}$patternList
} fileList o]} {
return -options $o $fileList
}
@@ -145,7 +145,7 @@ proc pkg_mkIndex {args} {
# interpreter, and get a list of the new commands and packages
# that are defined.
- if {[string equal $file pkgIndex.tcl]} {
+ if {$file eq "pkgIndex.tcl"} {
continue
}
@@ -154,7 +154,7 @@ proc pkg_mkIndex {args} {
# Load into the child any packages currently loaded in the parent
# interpreter that match the -load pattern.
- if {[string length $loadPat]} {
+ if {$loadPat ne ""} {
if {$doVerbose} {
tclLog "currently loaded packages: '[info loaded]'"
tclLog "trying to load all packages matching $loadPat"
@@ -180,7 +180,7 @@ proc pkg_mkIndex {args} {
} elseif {$doVerbose} {
tclLog "loaded [lindex $pkg 0] [lindex $pkg 1]"
}
- if {[string equal [lindex $pkg 1] "Tk"]} {
+ if {[lindex $pkg 1] eq "Tk"} {
# Withdraw . if Tk was loaded, to avoid showing a window.
$c eval [list wm withdraw .]
}
@@ -263,7 +263,7 @@ proc pkg_mkIndex {args} {
set ::tcl::namespaces($::tcl::x) 1
}
foreach ::tcl::x [package names] {
- if {[string compare [package provide $::tcl::x] ""]} {
+ if {[package provide $::tcl::x] ne ""} {
set ::tcl::packages($::tcl::x) 1
}
}
@@ -311,7 +311,7 @@ proc pkg_mkIndex {args} {
set ::tcl::newCmds($::tcl::x) 1
}
foreach ::tcl::x $::tcl::origCmds {
- catch {unset ::tcl::newCmds($::tcl::x)}
+ unset -nocomplain ::tcl::newCmds($::tcl::x)
}
foreach ::tcl::x [array names ::tcl::newCmds] {
# determine which namespace a command comes from
@@ -324,7 +324,7 @@ proc pkg_mkIndex {args} {
set ::tcl::abs \
[lindex [auto_qualify $::tcl::abs ::] 0]
- if {[string compare $::tcl::x $::tcl::abs]} {
+ if {$::tcl::x ne $::tcl::abs} {
# Name changed during qualification
set ::tcl::newCmds($::tcl::abs) 1
@@ -338,7 +338,7 @@ proc pkg_mkIndex {args} {
# a version provided, then record it
foreach ::tcl::x [package names] {
- if {[string compare [package provide $::tcl::x] ""] \
+ if {[package provide $::tcl::x] ne ""
&& ![info exists ::tcl::packages($::tcl::x)]} {
lappend ::tcl::newPkgs \
[list $::tcl::x [package provide $::tcl::x]]
@@ -437,7 +437,7 @@ proc tclPkgSetup {dir pkg version files} {
set f [lindex $fileInfo 0]
set type [lindex $fileInfo 1]
foreach cmd [lindex $fileInfo 2] {
- if {[string equal $type "load"]} {
+ if {$type eq "load"} {
set auto_index($cmd) [list load [file join $dir $f] $pkg]
} else {
set auto_index($cmd) [list source [file join $dir $f]]