-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpkgIndex.tcl.in
executable file
·46 lines (41 loc) · 1.58 KB
/
pkgIndex.tcl.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[package vsatisfies [package provide Tcl] 8.4]} {
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 {}
}
}
}