Hi TCLers,
I think I did not have this problem in older versions but I'm sure about
that.
I have a standard development package with tools (like debug routines,
etc.) called AppUtil. It is required in all development projects.
In scan_code.tcl I have the statements:
package require AppUtil
namespace import AppUtil::Debug AppUtil::GetConfig AppUtil::SetConfig
package provide ScanLib 0.1
namespace eval ScanLib {
variable ResultBuffer
...
proc do_di_scan {dev_name} {
...
}
}
No I faced the problem that I can't create a package index if I try to
import my AppUtil::* functions, I get the following error message (it is
called warning here):
% pkg_mkIndex -verbose lib/modules *.tcl
warning: error while sourcing scan_code.tcl: unknown namespace in import pattern "AppUtil::Debug"
... and the scan_code.tcl package is NOT included into the package
index.
If I remove the "namespace import AppUtil::Debug" all works as expected.
% pkg_mkIndex -verbose lib/modules *.tcl
successful sourcing of scan_code.tcl
packages provided were {ScanLibrary 0.1}
processed scan_code.tcl
I can add again the namespace import after creating the package index
and everything works without problems either.
$ tclsh
% package require ScanLibrary
0.1
% AppUtil::SetConfig
wrong # args: should be "AppUtil::SetConfig key ?arg ...?"
The last error message shows that the AppUtill package is sourced
correctly.
Now my questions are:
1. Is this an inteded behavior?
2. What am I doing wrong?
3. How to circumvent this problem (maybe answered with 2.)
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(engine) = Tcl
tcl_platform(machine) = x86_64
tcl_platform(os) = Linux
tcl_platform(osVersion) = 4.9.0-2-amd64
tcl_platform(pathSeparator) = :
tcl_platform(platform) = unix
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = gerhard
tcl_platform(wordSize) = 8
% info patchlevel
8.6.6
Bye,
Gerhard
--
Gerhard Reithofer - Techn. EDV Reithofer -
http://www.tech-edv.co.at