Monday, June 11, 2007

Extending Tcl's package include directories at run-time

A quick one here:
Say you are debugging a tcl package and have a local copy to debug.

To make the tcl script pick up the local copy of the package:

- If the tcl script is editable, append to auto_path as

set auto_path "./src $::auto_path"
package require Foo
Note that you would need to create a pkgIndex.tcl in the directory where your local copy exists.

- If the tcl script is not-editable, use TCLLIBPATH env var. Haven't tried it though.

o&o

No comments: