Tcl Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Ticket UUID: 219279
Title: pkg_mkIndex incorrectly handles namespace import command
Type: Bug Version: obsolete: 8.1b3
Submitter: nobody Created on: 2000-10-26 05:09:48
Subsystem: 39. Package Manager Assigned To: dgp
Priority: 5 Medium Severity:
Status: Open Last Modified: 2001-02-08 13:30:13
Resolution: None Closed By:
    Closed on:
Description:
OriginalBugID: 1904 Bug
Version: 8.1b3
SubmitDate: '1999-04-19'
LastModified: '2000-10-25'
Severity: MED
Status: UnAssn
Submitter: pat
OS: Windows NT
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
Charles W. Hooks

Comments:
I am thrilled that you fixed the problem in tcl8.1b1 where the package
    command died when it hit the namespace import command.  I solved half of
    my problems.  Now for the otehr half. :)

ReproducibleScript:
file: foo.tcl
    
    package provide JCS_task_service 1.0
    
    namespace eval ::JCS_task_service:: {
        namespace export {[a-z]*}
    }
    
    proc ::JCS_task_service::foo {} {
        puts "FOO!"
    }
    
    namespace import ::JCS_task_service::foo
    
    -----------------------------------------
    use the following command in a normal tclsh
    
    pkg_mkIndex . *.tcl

ObservedBehavior:
This creates a pkgIndex.tcl file with the following line:
    
    package ifneeded JCS_task_service 1.0 [list tclPkgSetup $dir
    JCS_task_service 1.0 {{./services/tasks/task_service.tcl source
    ::JCS_task_service::foo}}]

DesiredBehavior:
It should create a pkgIndex.tcl file with the following line:
    
    package ifneeded JCS_task_service 1.0 [list tclPkgSetup $dir
    JCS_task_service 1.0 {{./services/tasks/task_service.tcl source foo}
    {./services/tasks/task_service.tcl source ::JCS_task_service::foo}}]
    
    or:
    
    package ifneeded JCS_task_service 1.0 [list tclPkgSetup $dir
    JCS_task_service 1.0 {{./services/tasks/task_service.tcl source foo}}]