Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem running pkg_mkIndex on tbc files.

1 view
Skip to first unread message

Jay Rohr

unread,
Feb 18, 2003, 10:59:21 PM2/18/03
to
This is a repost of the original question with addition info.

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.

Don Porter

unread,
Feb 19, 2003, 12:02:39 AM2/19/03
to
Jay Rohr <jr...@bellatlantic.net> wrote:
>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'

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 |
|______________________________________________________________________|

Jay Rohr

unread,
Feb 19, 2003, 8:12:29 PM2/19/03
to
Don Porter wrote:
> Jay Rohr <jr...@bellatlantic.net> wrote:
>
>>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'
>
>
> 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
>
>
I did that - the error goes away but still not index file.

Don Porter

unread,
Feb 20, 2003, 12:39:33 AM2/20/03
to
In article <3E542B1F...@bellatlantic.net>, Jay Rohr wrote:
>> First do:
>>
>> % package require tbcload
>>
>> then try
>>
>>
>>>% pkg_mkIndex -verbose -load tbcload . *.tbc
>>
>>
> I did that - the error goes away but still not index file.

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 |
|______________________________________________________________________|

Jay Rohr

unread,
Feb 20, 2003, 6:12:23 PM2/20/03
to
Don Porter wrote:
> In article <3E542B1F...@bellatlantic.net>, Jay Rohr wrote:
>
>>>First do:
>>>
>>>% package require tbcload
>>>
>>>then try
>>>
>>>
>>>
>>>>% pkg_mkIndex -verbose -load tbcload . *.tbc
>>>
>>>
>>I did that - the error goes away but still not index file.
>
>
> 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?
>

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]


Jeffrey Hobbs

unread,
Feb 21, 2003, 2:20:05 AM2/21/03
to
Jay Rohr wrote:
> 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.

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

Jay Rohr

unread,
Feb 22, 2003, 7:10:40 AM2/22/03
to
Jeffrey Hobbs wrote:
> Jay Rohr wrote:
>
>> 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.
>
>
> 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:
>
>
You the Man (Guy)! Thanks

This also confirms somethnig that I have suspected for a while - my
news provider is dropping articles!


Mike Collins

unread,
Feb 25, 2003, 12:57:15 PM2/25/03
to
Jeffrey Hobbs <Je...@ActiveState.com> wrote in message news:<3E55D356...@ActiveState.com>...

>
> 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?

Jeff Hobbs

unread,
Feb 25, 2003, 2:50:21 PM2/25/03
to
[posted and mailed]

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). :)

Bruce Hartweg

unread,
Feb 25, 2003, 10:20:53 PM2/25/03
to

You're nice, I had guessed "Google the * Group" ;^)

Bruce

0 new messages