Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Error with pkg_mkindex

Closed / Fixed218583ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:02:44
OriginalBugID: 1327 Bug
Version: 8.1b1
SubmitDate: '1999-03-02'
LastModified: '1999-04-01'
Severity: MED
Status: Released
Submitter: pat
ChangedBy: welch
OS: Windows NT
OSVersion: 4.0sp3
Machine: X86
FixedDate: '1999-04-01'
ClosedDate: '2000-10-25'


Name:
Charles W. Hooks

Extensions:
none

CustomShell:
none

ReproducibleScript:
      The follow code, supplied in a Tcl library file causes pkg_mkindex to
    die.
    The function provided in the namespace for the package is imported into
    the
    global scope for easy use.  The reason is was not declared in the global
    scope is that it uses many functions in that namespace as well as
    variables.
    It would be nice if pkg_mkindex would handle to namespace import line
    with
    out aborting/erroring out.  If it ignored the line, things would be
    fine.
    I would get an index for all of my commands and I would have to hand
    edit
    the namespace from foo and things would work, though it pkg_mkindex
    would
    perform this as well, things would be great!
    
      Save code in a file called test.tcl
    
    pkg_mkIndex . test.tcl
    
    This will create an empty pkgIndex.tcl file, even if you have other
    commands
    entered after the problem line.
    
    #####broken code#####
    
    package provide fubar 1.0
    
    namespace eval ::fubar:: {
        #
        # export only public functions.
        #
        namespace export {[a-z]*}
    }
    
    proc ::fubar::foo {bar} {
        puts "$bar"
        return true
    }
    
    namespace import ::fubar::foo
    



ObservedBehavior:
    empty pkgIndex.tcl file.
    



DesiredBehavior:
    package indexes for the functions in the file.  In the case of the
    namespace
    imported command, we should see that command indexed in the global scope
    as
    well as teh namespace scope.
    




I simply added "-force" to the import done by pkg_mkIndex so it
doesn't care if the script that was sourced already did an import.
welch Closed ticket [218583ffff]. [History diff]2000-10-26 08:25:08
dgp Ticket [218583ffff]: 3 changes [History diff]2001-04-17 05:00:23
Log in (anonymous is fine) to add a comment.