-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pkgIndex.tcl.in: Fixed procedure collisions for Thread package
by inlining the load command into the ifneeded script, as is standard for most binary packages. Tweaked the procedure for Ttrace a bit, as the result of [info commands] is a list, and using ::apply when possible. A named procedure is only a fallback.
- Loading branch information
andreas_kupries
committed
May 31, 2010
1 parent
43ab068
commit cb41c52
Showing
2 changed files
with
49 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
2010-05-31 Andreas Kupries <[email protected]> | ||
|
||
* pkgIndex.tcl.in: Fixed procedure collisions for Thread package | ||
by inlining the load command into the ifneeded script, as is | ||
standard for most binary packages. Tweaked the procedure for | ||
Ttrace a bit, as the result of [info commands] is a list, and | ||
using ::apply when possible. A named procedure is only a fallback. | ||
|
||
2010-05-27 Andreas Kupries <[email protected]> | ||
|
||
* lib/ttrace.tcl: Resynchronized version number with Thread. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,46 @@ | ||
# | ||
# -*- tcl -*- | ||
# Tcl package index file, version 1.1 | ||
# | ||
if {[package vsatisfies [package provide Tcl] 8.4]} { | ||
package ifneeded Thread @PACKAGE_VERSION@ [list @PACKAGE_NAME@_load $dir] | ||
package ifneeded Ttrace @PACKAGE_VERSION@ [list @PACKAGE_NAME@_source $dir] | ||
proc @PACKAGE_NAME@_load {dir} { | ||
load [file join $dir @PKG_LIB_FILE@] | ||
rename @PACKAGE_NAME@_load {} | ||
} | ||
proc @PACKAGE_NAME@_source {dir} { | ||
if {[info exists ::env(TCL_THREAD_LIBRARY)] && | ||
[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { | ||
source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl | ||
} elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { | ||
source [file join $dir .. lib ttrace.tcl] | ||
} elseif {[file readable [file join $dir ttrace.tcl]]} { | ||
source [file join $dir ttrace.tcl] | ||
} | ||
if {[info commands ttrace::update] ne ""} { | ||
ttrace::update | ||
} | ||
rename @PACKAGE_NAME@_source {} | ||
|
||
package ifneeded Thread @PACKAGE_VERSION@ [list load [file join $dir @PKG_LIB_FILE@]] | ||
|
||
if {[llength [info commands apply]]} { | ||
# We can use a lambda (anon function). | ||
|
||
package ifneeded Ttrace @PACKAGE_VERSION@ [list ::apply {{dir} { | ||
if {[info exists ::env(TCL_THREAD_LIBRARY)] && | ||
[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { | ||
source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl | ||
} elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { | ||
source [file join $dir .. lib ttrace.tcl] | ||
} elseif {[file readable [file join $dir ttrace.tcl]]} { | ||
source [file join $dir ttrace.tcl] | ||
} | ||
if {[llength [info commands ttrace::update]]} { | ||
ttrace::update | ||
} | ||
}} $dir] | ||
} else { | ||
# No anon functions available, go with the necessary evil of a | ||
# named procedure, but use package specific prefix and no | ||
# hardwired data changing between package versions. | ||
|
||
package ifneeded Ttrace @PACKAGE_VERSION@ [list @PACKAGE_NAME@_source $dir] | ||
|
||
proc @PACKAGE_NAME@_source {dir} { | ||
if {[info exists ::env(TCL_THREAD_LIBRARY)] && | ||
[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { | ||
source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl | ||
} elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { | ||
source [file join $dir .. lib ttrace.tcl] | ||
} elseif {[file readable [file join $dir ttrace.tcl]]} { | ||
source [file join $dir ttrace.tcl] | ||
} | ||
if {[llength [info commands ttrace::update]]} { | ||
ttrace::update | ||
} | ||
rename @PACKAGE_NAME@_source {} | ||
} | ||
} | ||
} |