Different versions of a package may be loaded in different interpreters. The generated index will manage to load the package immediately upon package require instead of delaying loading until actual use of one of the commands. The index process will pre-load any packages that exist in the current interpreter and match pkgPat into the slave interpreter used to generate the index. The pattern match uses string match rules. Generate output during the indexing process.
Output is via the tclLog procedure, which by default prints to stderr.
End of the flags, in case dir begins with a dash. The first time a package require command is invoked, the package unknown script is invoked. Unless the -direct flag was provided when the pkgIndex.tcl was generated, a given file of a given version of a given package isn't actually loaded until the first time one of its commands is invoked. Thus, after invoking package require you may not see the package's commands in the interpreter, but you will be able to invoke the commands and they will be auto-loaded. Some packages, for instance packages which use namespaces and export commands or those which require special initialization, might select that their package files be loaded immediately upon package require instead of delaying the actual loading to the first use of one of the package's command.