pkg_mkIndex
pkg_mkIndex ?-direct? ?-lazy? ?-load PATTERN? ?-verbose? ?--? dir ?pattern ...?
Writes the pkgIndex.tcl file of a folder, as Tcl does. Each file of the patterns (the default is *.tcl and the files of shared libraries) goes into a new child interpreter, which notes the packages that the file provides and the commands that it makes. A file that fails goes again after the others, with the packages that the others provide. -direct (the default) gives an ifneeded script that sources the files, and -lazy one that puts the commands in auto_index through tclPkgSetup. pkg::create gives one line of such an index.
This page also has pkg::create, tcl::Pkg::CompareExtension, tcl::Pkg::Index.
Examples
pkg::create -name foo -version 1.0 -source foo.tclgivespackage ifneeded foo 1.0 [list source [file join $dir foo.tcl]]
Facts
- Capability:
package. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.