diff --git a/src/port/port.tcl b/src/port/port.tcl
index f0b256bf..9ee1fe14 100755
a
|
b
|
proc action_variants { action portlist opts } { |
3682 | 3682 | } |
3683 | 3683 | |
3684 | 3684 | # XXX Keep these varmodifiers in sync with action_info, or create a wrapper for it |
3685 | | if {[info exists variations($v)]} { |
3686 | | set varmodifier " $variations($v)" |
3687 | | } elseif {[info exists global_variations($v)]} { |
| 3685 | set user_supplied_vname [lsearch -inline -nocase -exact [array names variations] $v] |
| 3686 | set user_supplied_global_vname [lsearch -inline -nocase -exact [array names global_variations] $v] |
| 3687 | if {[info exists variations($user_supplied_vname)]} { |
| 3688 | set varmodifier " $variations($user_supplied_vname)" |
| 3689 | } elseif {[info exists global_variations($user_supplied_global_vname)]} { |
3688 | 3690 | # selected by variants.conf, prefixed with (+)/(-) |
3689 | | set varmodifier "($global_variations($v))" |
| 3691 | set varmodifier "($global_variations($user_supplied_global_vname))" |
3690 | 3692 | } elseif {[info exists variant(is_default)]} { |
3691 | 3693 | set varmodifier "\[$variant(is_default)\]" |
3692 | 3694 | } |
diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
index 31fd56b7..b29782d6 100644
a
|
b
|
proc variant {args} { |
660 | 660 | proc variant_isset {name} { |
661 | 661 | global variations |
662 | 662 | |
663 | | if {[info exists variations($name)] && $variations($name) eq "+"} { |
| 663 | set canonical_name [lsearch -exact -nocase -inline [array names variations] $name] |
| 664 | if {$canonical_name eq ""} { |
| 665 | return 0 |
| 666 | } |
| 667 | if {$variations($canonical_name) eq "+"} { |
664 | 668 | return 1 |
665 | 669 | } |
666 | 670 | return 0 |
… |
… |
proc eval_variants {variations} { |
1964 | 1968 | global all_variants PortInfo requested_variations portvariants negated_variants |
1965 | 1969 | set dlist $all_variants |
1966 | 1970 | upvar $variations upvariations |
1967 | | set chosen [choose_variants $dlist upvariations] |
1968 | | set negated [lindex $chosen 1] |
1969 | | set chosen [lindex $chosen 0] |
1970 | | set portname [option subport] |
1971 | 1971 | |
1972 | 1972 | # Check to make sure the requested variations are available with this |
1973 | 1973 | # port, if one is not, warn the user and remove the variant from the |
… |
… |
proc eval_variants {variations} { |
1975 | 1975 | # Save the originally requested set in requested_variations. |
1976 | 1976 | array set requested_variations [array get upvariations] |
1977 | 1977 | foreach key [array names upvariations *] { |
1978 | | if {![info exists PortInfo(variants)] || |
1979 | | $key ni $PortInfo(variants)} { |
| 1978 | set canonical_variant_key "" |
| 1979 | if {[info exists PortInfo(variants)]} { |
| 1980 | set canonical_variant_key [lsearch -inline -nocase -exact $PortInfo(variants) $key] |
| 1981 | } |
| 1982 | if {$canonical_variant_key eq ""} { |
1980 | 1983 | ui_debug "Requested variant $upvariations($key)$key is not provided by port $portname." |
1981 | 1984 | array unset upvariations $key |
| 1985 | } else { |
| 1986 | set varspec $upvariations($key) |
| 1987 | array unset upvariations $key |
| 1988 | set upvariations($canonical_variant_key) $varspec |
| 1989 | puts "Replacing $key variant with $canonical_variant_key" |
1982 | 1990 | } |
1983 | 1991 | } |
1984 | 1992 | |
| 1993 | set chosen [choose_variants $dlist upvariations] |
| 1994 | set negated [lindex $chosen 1] |
| 1995 | set chosen [lindex $chosen 0] |
| 1996 | set portname [option subport] |
| 1997 | |
1985 | 1998 | # now that we've selected variants, change all provides [a b c] to [a-b-c] |
1986 | 1999 | # this will eliminate ambiguity between item a, b, and a-b while fulfilling requirements. |
1987 | 2000 | #foreach obj $dlist { |