Changeset 1017 for trunk/base
- Timestamp:
- Oct 9, 2002, 10:11:27 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port1.0/portutil.tcl
r1015 r1017 33 33 package require Pextlib 1.0 34 34 35 global targets target_uniqid variants35 global targets target_uniqid all_variants 36 36 37 37 set targets [list] 38 38 set target_uniqid 0 39 39 40 set variants [list]40 set all_variants [list] 41 41 42 42 ########### External High Level Procedures ########### … … 207 207 # Portfile level procedure to provide support for declaring variants 208 208 proc variant {args} { 209 global variants PortInfo209 global all_variants PortInfo 210 210 upvar $args upargs 211 211 … … 236 236 $obj append requires $requires 237 237 $obj set code $code 238 lappend variants $obj238 lappend all_variants $obj 239 239 240 240 # Export provided variant to PortInfo … … 380 380 # thought of any other way to do this. 381 381 proc makeuserproc {name body} { 382 regsub -- "^\{(.* )" $body "\{ \n foreach g \[info globals\] \{ \n global \$g \n \} \n \\1" body382 regsub -- "^\{(.*?)" $body "\{ \n eval \"global \[info globals\]\" \n \\1" body 383 383 eval "proc $name {} $body" 384 384 } … … 743 743 set name [$this get name] 744 744 ui_debug "Executing $name provides [$this get provides]" 745 makeuserproc $ name-code "\{[$this get code]\}"746 if ([catch $ name-code result]) {745 makeuserproc ${name}-code "[$this get code]" 746 if ([catch ${name}-code result]) { 747 747 ui_error "Error executing $name: $result" 748 748 return 1 … … 752 752 753 753 proc eval_variants {variations} { 754 global variants755 set dlist $ variants754 global all_variants 755 set dlist $all_variants 756 756 upvar $variations upvariations 757 757 set chosen [choose_variants $dlist upvariations] … … 995 995 } 996 996 997 997 options variants.default 998 option_proc variants.default handle_variants.default 999 proc handle_variants.default {option action args} { 1000 global variations 1001 switch -regex $action { 1002 set|append { 1003 foreach v $args { 1004 if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} { 1005 if {![info exists variations($variant)]} { 1006 set variations($variant) $val 1007 } 1008 } 1009 } 1010 } 1011 delete { 1012 # xxx 1013 } 1014 } 1015 } 998 1016 999 1017 ##### portfile depspec subclass #####
Note: See TracChangeset
for help on using the changeset viewer.