This is probably an RTFM question, but I can't find it.
I've used the TDK-Beta 2 procomp to compile one of my 'working' packages
- and they source and work correctly.
When I try to create the package index with
'pkg_mkindex -load tbcload . *.tbc'
I get the following error and a blank pkgIndex.tcl file.
warning: no packages are currently loaded, nothing
can possibly match 'tbcload'
This happens both on linux and windows.
Sorry if this is 'Operator Error'
Here is a complete example:
Source File: foo.tcl
--------------------------------------------------
proc foo {} {
puts "foo called"
}
package provide Foo 1.0
--------------------------------------------------
.tbc File head: foo.tbc
--------------------------------------------------
# TclPro::Compiler::Include
if {[catch {package require tbcload 1.4} err] == 1} {
error "The TclPro ByteCode Loader is not available or does not
support the correct version"
}
tbcload::bceval {
TclPro ByteCode 2 0 1.4 8.4
10 0 83 20 0 0 44 0 4 10 10 -1 -1
83
...
--------------------------------------------------
pkg_mkIndex Output:
--------------------------------------------------
% pkg_mkIndex -verbose -load tbcload . *.tbc
currently loaded packages: ''
trying to load all packages matching tbcload
warning: no packages are currently loaded, nothing
can possibly match 'tbcload'
successful sourcing of foo.tbc
commands provided were
packages provided were
processed foo.tbc
%
--------------------------------------------------
pkgIndex.tcl Content:
--------------------------------------------------
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex -load tbcload" command
# and sourced either when an application starts up or
# by a "package unknown" script. It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.
Looks like the interp in which you eval [pkg_mkIndex] doesn't
have tbcload in it.
>--------------------------------------------------
>pkg_mkIndex Output:
>--------------------------------------------------
First do:
% package require tbcload
then try
>% pkg_mkIndex -verbose -load tbcload . *.tbc
--
| Don Porter dgpo...@erols.com |
| "Some days you just can't get rid of a bomb!" |
| -- Adam West as BATMAN |
|______________________________________________________________________|
Are we solving the wrong problem?
Do you know what the index script should look like? Why not just
create it instead of trying to jump through [pkg_mkIndex] hoops
without success?
Perhaps it's time for someone who's used tbcload to step in here.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
Sure - I could run pkg_mkIndex on the .tcl files and then replace
all .tcl with .tbc. But this will not work if the directory has both
.tcl and .tbc package files. :-(
> Perhaps it's time for someone who's used tbcload to step in here.
>
Please !!! I have posted this request to the TDK mailing list but have
not seen a reply. [Incentive: If I can demonstrate to myself that
I can use TDK to do the things I need done - I will probably shell out
the $$ to use it]
This is actually something that you will find the answer for from me
on clt from the Dec 2002. Thus, it's not RTFM, but rather GTFG. Hey,
do I get to win anything for coining that acronym? :)
In any case, here it is again, with more specifics:
The way this must be done is:
package require tbcload
pkg_mkIndex -verbose -load Tbcload . *.tbc; # -verbose optional
Why oh why is this so screwy, you rightly ask?
Well, it all makes sense when you know how dump pkg_mkIndex is (and
perhaps it is time to change that ...). It only matches things in
'info loaded', NOT 'package names', which means you have to preload
any packages in the interp. Also, it checks for the _Init name that
it found, which isn't necessarily the same as the package. In this
case it is *T*bcload.
I think 2 changes would be appropriate immediately for pkg_mkIndex:
1) Use string match -nocase for matching.
2) Try and 'package require' the stated package instead of just
relying on info loaded.
--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions
This also confirms somethnig that I have suspected for a while - my
news provider is dropping articles!
>
> This is actually something that you will find the answer for from me
> on clt from the Dec 2002. Thus, it's not RTFM, but rather GTFG. Hey,
> do I get to win anything for coining that acronym? :)
> In any case, here it is again, with more specifics:
>
Ok Jeff I've always liked RTFM, what's GTFG?
moca...@yahoo.com (Mike Collins) wrote in
news:71deda01.03022...@posting.google.com:
Go To Friendly Google. Perhaps GSFG is more appropriate, but I thought
it was good to keep the TF in there (even if not 100% the same). :)
You're nice, I had guessed "Google the * Group" ;^)
Bruce