Ignore:
Timestamp:
Oct 13, 2002, 10:19:04 AM (16 years ago)
Author:
jkh
Message:

Fixup a little whitespace.

File:
1 edited

Legend:

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

    r1045 r1047  
    236236    $obj append requires $requires
    237237
    238         # make a user procedure named variant-blah-blah
    239         # well will call this procedure during variant-run
    240         makeuserproc $name \{$code\}
     238    # make a user procedure named variant-blah-blah
     239    # well will call this procedure during variant-run
     240    makeuserproc $name \{$code\}
    241241    lappend all_variants $obj
    242242   
     
    451451proc dlist_evaluate {dlist get_next_proc} {
    452452    global portname
    453        
     453   
    454454    # status - keys will be node names, values will be {-1, 0, 1}.
    455455    array set statusdict [list]
    456        
     456   
    457457    # XXX: Do we want to evaluate this dynamically instead of statically?
    458458    foreach obj $dlist {
     
    724724    ui_debug "Executing $name provides [$this get provides]"
    725725    # execute proc with same name as variant.
    726         if {[catch ${name} result]} {
     726    if {[catch ${name} result]} {
    727727        ui_error "Error executing $name: $result"
    728728        return 1
     
    805805
    806806proc depspec_get {this prop} {
    807         set data [$this _data]
    808         global $data
    809         if {[eval info exists ${data}($prop)]} {
    810                 eval return $${data}($prop)
    811         } else {
    812                 return ""
    813         }
     807    set data [$this _data]
     808    global $data
     809    if {[eval info exists ${data}($prop)]} {
     810        eval return $${data}($prop)
     811    } else {
     812        return ""
     813    }
    814814}
    815815
    816816proc depspec_set {this prop args} {
    817         set data [$this _data]
    818         global $data
    819         eval "set ${data}($prop) \"$args\""
     817    set data [$this _data]
     818    global $data
     819    eval "set ${data}($prop) \"$args\""
    820820}
    821821
    822822proc depspec_has {this prop} {
    823         set data [$this _data]
    824         global $data
    825         eval return \[info exists ${data}($prop)\]
     823    set data [$this _data]
     824    global $data
     825    eval return \[info exists ${data}($prop)\]
    826826}
    827827
    828828proc depspec_append {this prop args} {
    829         set data [$this _data]
    830         global $data
    831         set vals [join $args " "]
    832         eval lappend ${data}($prop) $vals
     829    set data [$this _data]
     830    global $data
     831    set vals [join $args " "]
     832    eval lappend ${data}($prop) $vals
    833833}
    834834
     
    839839proc depspec_dispatch {this data method args} {
    840840    global $data
    841         if {$method == "_data"} { return $data }
    842         eval set vtbl $${data}(_vtbl)
    843         global $vtbl
    844         if {[info exists ${vtbl}($method)]} {
    845                 eval set function $${vtbl}($method)
    846                 eval "return \[$function $this $args\]"
    847         } else {
    848                 ui_error "unknown method: $method"
    849         }
     841    if {$method == "_data"} { return $data }
     842    eval set vtbl $${data}(_vtbl)
     843    global $vtbl
     844    if {[info exists ${vtbl}($method)]} {
     845        eval set function $${vtbl}($method)
     846        eval "return \[$function $this $args\]"
     847    } else {
     848        ui_error "unknown method: $method"
     849    }
    850850    return ""
    851851}
     
    874874# constructor for target depspec class
    875875proc target_new {name procedure} {
    876         global targets
    877         set obj [depspec_new $name]
     876    global targets
     877    set obj [depspec_new $name]
    878878   
    879879    $obj set _vtbl target_vtbl
    880         $obj set procedure $procedure
    881    
    882         lappend targets $obj
    883        
     880    $obj set procedure $procedure
     881   
     882    lappend targets $obj
     883   
    884884    return $obj
    885885}
    886886
    887887proc target_provides {this args} {
    888         global targets
    889         # Register the pre-/post- hooks for use in Portfile.
    890         # Portfile syntax: pre-fetch { puts "hello world" }
    891         # User-code exceptions are caught and returned as a result of the target.
    892         # Thus if the user code breaks, dependent targets will not execute.
    893         foreach target $args {
    894                 if {[info commands $target] != ""} {
    895                         ui_error "$name attempted to register provide \'$target\' which is a pre-existing procedure. Ignoring register."
    896                         continue;
    897                 }
    898                 set origproc [$this get procedure]
    899                 set ident [$this get name]
    900                 eval "proc $target {args} \{ \n\
     888    global targets
     889    # Register the pre-/post- hooks for use in Portfile.
     890    # Portfile syntax: pre-fetch { puts "hello world" }
     891    # User-code exceptions are caught and returned as a result of the target.
     892    # Thus if the user code breaks, dependent targets will not execute.
     893    foreach target $args {
     894        if {[info commands $target] != ""} {
     895            ui_error "$name attempted to register provide \'$target\' which is a pre-existing procedure. Ignoring register."
     896            continue;
     897        }
     898        set origproc [$this get procedure]
     899        set ident [$this get name]
     900        eval "proc $target {args} \{ \n\
    901901                        $this set procedure proc-${ident}-${target}
    902902                        eval \"proc proc-${ident}-${target} \{name\} \{ \n\
     
    911911                        makeuserproc userproc-${ident}-${target} \$args \n\
    912912                \}"
    913                 eval "proc pre-$target {args} \{ \n\
     913        eval "proc pre-$target {args} \{ \n\
    914914                        $this append pre proc-pre-${ident}-${target}
    915915                        eval \"proc proc-pre-${ident}-${target} \{name\} \{ \n\
     
    923923                        makeuserproc userproc-pre-${ident}-${target} \$args \n\
    924924                \}"
    925                 eval "proc post-$target {args} \{ \n\
     925        eval "proc post-$target {args} \{ \n\
    926926                        $this append post proc-post-${ident}-${target}
    927927                        eval \"proc proc-post-${ident}-${target} \{name\} \{ \n\
     
    935935                        makeuserproc userproc-post-${ident}-${target} \$args \n\
    936936                \}"
    937         }
    938         eval "depspec_append $this provides $args"
     937    }
     938    eval "depspec_append $this provides $args"
    939939}
    940940
    941941proc target_requires {this args} {
    942         eval "depspec_append $this requires $args"
     942    eval "depspec_append $this requires $args"
    943943}
    944944
    945945proc target_uses {this args} {
    946         eval "depspec_append $this uses $args"
     946    eval "depspec_append $this uses $args"
    947947}
    948948
    949949proc target_deplist {this args} {
    950         eval "depspec_append $this deplist $args"
     950    eval "depspec_append $this deplist $args"
    951951}
    952952
    953953proc target_prerun {this args} {
    954         eval "depspec_append $this prerun $args"
     954    eval "depspec_append $this prerun $args"
    955955}
    956956
    957957proc target_postrun {this args} {
    958         eval "depspec_append $this postrun $args"
     958    eval "depspec_append $this postrun $args"
    959959}
    960960
     
    976976
    977977proc handle_default_variants {option action args} {
    978         global variations
     978    global variations
    979979    switch -regex $action {
    980                 set|append {
    981                         foreach v $args {
    982                                 if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} {
    983                                         if {![info exists variations($variant)]} {
    984                                                 set variations($variant) $val
    985                                         }
    986                                 }
    987                         }
     980        set|append {
     981            foreach v $args {
     982                if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} {
     983                    if {![info exists variations($variant)]} {
     984                        set variations($variant) $val
     985                    }
    988986                }
    989                 delete {
    990                         # xxx
    991                 }
     987            }
     988        }
     989        delete {
     990            # xxx
     991        }
    992992    }
    993993}
Note: See TracChangeset for help on using the changeset viewer.