summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--changes6
-rw-r--r--library/auto.tcl83
3 files changed, 66 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index fec6636..a942e43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-16 Don Porter <dgp@users.sourceforge.net>
+
+ * library/auto.tcl: Updated [tcl_findLibrary] search path
+ to include the $::auto_path. [RFE 695441].
+
2004-11-16 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* doc/tclvars.n: Mention global variables set by tclsh and wish so
diff --git a/changes b/changes
index 97cfcef..1d3fd33 100644
--- a/changes
+++ b/changes
@@ -1,6 +1,6 @@
Recent user-visible changes to Tcl:
-RCS: @(#) $Id: changes,v 1.79.2.13 2004/11/15 21:52:26 dgp Exp $
+RCS: @(#) $Id: changes,v 1.79.2.14 2004/11/16 16:56:00 dgp Exp $
1. No more [command1] [command2] construct for grouping multiple
commands on a single command line.
@@ -6104,7 +6104,9 @@ Corrects Tcl_StatBuf definition issues. (hobbs)
2004-11-15 (bug fix)[10653678] [trace variable],[trace remove] interop (porter)
-Documentation improvements [759545,1058446,1062647,etc.]
+2004-11-16 (bug fix)[695441] [tcl_findLibrary] search $::auto_path too (porter)
+
+Documentation improvements [759545,1058446,1062647,1065732,etc.]
Test suite expansion [1036649,1001997,etc.]
--- Released 8.4.8, November XX, 2004 --- See ChangeLog for details ---
diff --git a/library/auto.tcl b/library/auto.tcl
index 4c736fe..d3a3fab 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl dealing with auto execution
# of commands and can be auto loaded themselves.
#
-# RCS: @(#) $Id: auto.tcl,v 1.12 2002/10/28 16:34:25 dgp Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.12.2.1 2004/11/16 16:56:01 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -60,54 +60,85 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} {
set errors {}
# The C application may have hardwired a path, which we honor
-
+
set variableSet [info exists the_library]
- if {$variableSet && [string compare $the_library {}]} {
+ if {$variableSet && $the_library ne ""} {
lappend dirs $the_library
} else {
# Do the canonical search
- # 1. From an environment variable, if it exists
+ # 1. From an environment variable, if it exists.
+ # Placing this first gives the end-user ultimate control
+ # to work-around any bugs, or to customize.
if {[info exists env($enVarName)]} {
lappend dirs $env($enVarName)
}
- # 2. Relative to the Tcl library
-
- lappend dirs [file join [file dirname [info library]] \
- $basename$version]
+ # 2. In the package script directory registered within
+ # the configuration of the package itself.
+ #
+ # Only do this for Tcl 8.5+, when Tcl_RegsiterConfig() is available.
+ #if {[catch {
+ # ::${basename}::pkgconfig get scriptdir,runtime
+ #} value] == 0} {
+ # lappend dirs $value
+ #}
+
+ # 3. Relative to auto_path directories. This checks relative to the
+ # Tcl library as well as allowing loading of libraries added to the
+ # auto_path that is not relative to the core library or binary paths.
+ foreach d $::auto_path {
+ lappend dirs [file join $d $basename$version]
+ if {$::tcl_platform(platform) eq "unix"
+ && $::tcl_platform(os) eq "Darwin"} {
+ # 4. On MacOSX, check the Resources/Scripts subdir too
+ lappend dirs [file join $d $basename$version Resources Scripts]
+ }
+ }
# 3. Various locations relative to the executable
# ../lib/foo1.0 (From bin directory in install hierarchy)
# ../../lib/foo1.0 (From bin/arch directory in install hierarchy)
# ../library (From unix directory in build hierarchy)
- # ../../library (From unix/arch directory in build hierarchy)
- # ../../foo1.0.1/library
- # (From unix directory in parallel build hierarchy)
- # ../../../foo1.0.1/library
- # (From unix/arch directory in parallel build hierarchy)
-
set parentDir [file dirname [file dirname [info nameofexecutable]]]
set grandParentDir [file dirname $parentDir]
lappend dirs [file join $parentDir lib $basename$version]
lappend dirs [file join $grandParentDir lib $basename$version]
lappend dirs [file join $parentDir library]
- lappend dirs [file join $grandParentDir library]
- lappend dirs [file join $grandParentDir $basename$patch library]
- lappend dirs [file join [file dirname $grandParentDir] \
- $basename$patch library]
-
- # 4. On MacOSX, check the directories in the tcl_pkgPath
- if {[string equal $::tcl_platform(platform) "unix"] && \
- [string equal $::tcl_platform(os) "Darwin"]} {
- foreach d $::tcl_pkgPath {
- lappend dirs [file join $d $basename$version]
- lappend dirs [file join $d $basename$version Resources Scripts]
- }
+
+ # Remaining locations are out of date (when relevant, they ought
+ # to be covered by the $::auto_path seach above).
+ #
+ # ../../library (From unix/arch directory in build hierarchy)
+ # ../../foo1.0.1/library
+ # (From unix directory in parallel build hierarchy)
+ # ../../../foo1.0.1/library
+ # (From unix/arch directory in parallel build hierarchy)
+ #
+ # For the sake of extra compatibility safety, we keep adding these
+ # paths during the 8.4.* release series.
+ if {1} {
+ lappend dirs [file join $grandParentDir library]
+ lappend dirs [file join $grandParentDir $basename$patch library]
+ lappend dirs [file join [file dirname $grandParentDir] \
+ $basename$patch library]
+ }
+ }
+ # uniquify $dirs in order
+ array set seen {}
+ foreach i $dirs {
+ if {[interp issafe]} {
+ set norm $i
+ } else {
+ set norm [file normalize $i]
}
+ if {[info exists seen($norm)]} { continue }
+ set seen($norm) ""
+ lappend uniqdirs $norm
}
+ set dirs $uniqdirs
foreach i $dirs {
set the_library $i
set file [file join $i $initScript]