Version 5 of pkgIndex.tcl

Updated 2008-05-08 12:01:02 by LV

Purpose: document the who/what/where/when of the pkgIndex.tcl file.

See package for the details of how the pkgIndex.tcl file is used.

See also pkgmkindex.

This is different from the unknown proc and its use of tclIndex.

PkgIndexUtil.tcl - determining a platform name

Recently in comp.lang.tcl, DKF writes (in part) [L1 ]:

Further investigation reveals a badly-written pkgIndex.tcl file, so it 
is doing: 
   package ifneeded foo 1.0 "load [file join $dir foo.dll]" 
instead of: 
   package ifneeded foo 1.0 "load [file join $dir foo.dll]" 
(or one of the many variants on both those). 

I advise that all package authors should test their code when it is 
installed in a directory with a space (or square bracket) in the name, 
and if they find any problems, fix them using [list] carefully to wrap 
$dir or the value derived from it. (Remember, when you're in quoting 
hell, [list] is the road out.) 

and later he writes:

package ifneeded foo 1.0 [list apply {dir { 
     load [file join $dir foo.dll] 
     uplevel 1 [list source [file join $dir foo.tcl]] 
  }} $dir] 

while someone else comes along to this web page and offers

 package ifneeded foo 1.0 [load [file join $dir foo.dll]]