Ignore:
Timestamp:
Sep 21, 2002, 11:01:26 AM (16 years ago)
Author:
jkh
Message:

Add variant_set, variant_isset and variant_unset procedures

File:
1 edited

Legend:

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

    r712 r724  
    215215    # Export provided variant to PortInfo
    216216    lappend PortInfo(variants) $provides
     217}
     218
     219# variant_isset name
     220# Returns 1 if variant name selected, otherwise 0
     221proc variant_isset {name} {
     222    global variations
     223
     224    if {[info exists variations($name)] && $variations($name) == "+"} {
     225        return 1
     226    }
     227    return 0
     228}
     229
     230# variant_set name
     231# Sets variant to run for current portfile
     232proc variant_set {name} {
     233    global variations
     234
     235    set variations($name) +
     236}
     237
     238# variant_unset name
     239# Clear variant for current portfile
     240proc variant_unset {name} {
     241    global variations
     242
     243    set variations($name) -
    217244}
    218245
Note: See TracChangeset for help on using the changeset viewer.