-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkgIndex.tcl
35 lines (29 loc) · 1.16 KB
/
pkgIndex.tcl
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
# Copyright: 2007-2015 Paul Obermeier ([email protected])
# Distributed under BSD license.
# Extend the auto_path to make Cawt subpackages available
if {[lsearch -exact $::auto_path $dir] == -1} {
lappend ::auto_path $dir
}
proc _SetupCawtPkgs { dir version subDirs } {
foreach subDir $subDirs {
set pkg [string tolower $subDir]
set subDirPath [file join $dir $subDir]
set initFile [file join $subDirPath "pkgInit.tcl"]
if { [file readable $initFile] } {
source $initFile
package ifneeded $pkg $version [list _Init$subDir $subDirPath $version]
}
}
}
proc _LoadCawtPkgs { dir version subDirs } {
foreach subDir $subDirs {
set pkg [string tolower $subDir]
set retVal [catch { package require $pkg } ::__cawtPkgInfo($pkg,version)]
set ::__cawtPkgInfo($pkg,avail) [expr !$retVal]
}
package provide cawt $version
}
set _CawtSubDirs [list CawtCore CawtExcel CawtWord CawtPpt CawtOutlook \
CawtOcr CawtExplorer CawtEarth CawtMatlab]
_SetupCawtPkgs $dir 2.1.2 $_CawtSubDirs
package ifneeded cawt 2.1.2 [list _LoadCawtPkgs $dir 2.1.2 $_CawtSubDirs]