Changeset 1024 for trunk/base


Ignore:
Timestamp:
Oct 10, 2002, 1:26:26 AM (22 years ago)
Author:
kevin
Message:

create the procedure for a variant earlier in the process.
trying to store it as a variable made the quoting un-manageable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r1018 r1024  
    235235    $obj append provides $provides
    236236    $obj append requires $requires
    237     $obj set code $code
     237
     238        # make a user procedure named variant-blah-blah
     239        # well will call this procedure during variant-run
     240        makeuserproc $name \{$code\}
    238241    lappend all_variants $obj
    239242   
     
    380383# thought of any other way to do this.
    381384proc makeuserproc {name body} {
    382     regsub -- "^\{(.*?)" $body "\{ \n eval \"global \[info globals\]\" \n \\1" body
     385    regsub -- "^\{(.*?)" $body "\{ \n foreach g \[info globals\] \{ \n global \$g \n \} \n \\1" body
    383386    eval "proc $name {} $body"
    384387}
     
    743746    set name [$this get name]
    744747    ui_debug "Executing $name provides [$this get provides]"
    745     makeuserproc ${name}-code "[$this get code]"
    746     if ([catch ${name}-code result]) {
     748    # execute proc with same name as variant.
     749        if {[catch ${name} result]} {
    747750        ui_error "Error executing $name: $result"
    748751        return 1
Note: See TracChangeset for help on using the changeset viewer.