Ticket #38117: a_v_1.1_add-path.diff

File a_v_1.1_add-path.diff, 1.7 KB (added by michaelld (Michael Dickens), 12 years ago)
  • active_variants-1.1.tcl

     
    4545#
    4646# where
    4747#  $name
    48 #    is the name of the port you're trying to check (required)
     48#    is the name of the port you're trying to check (required), which can be
     49#    specified as either just the port, or via "(bin:lib:path):FOO:port"
     50#    as accepted by the dependency parser.
    4951#  $required
    5052#    is a list of variants that must be enabled for the test to succeed
    5153#    (required; remember this can also be a space-separated string or just
     
    104106        # same time). This explains the [lindex $active_list 0] in the following
    105107        # block.
    106108
     109        # get the port which will provide $name
     110        set port [_get_dep_port $name]
     111        if {$port == ""} {
     112            ui_error "active_variants: Error: invalid port name '${name}'"
     113            ui_error "  expecting either: port or (bin:lib:path):FOO:port"
     114            return 0
     115        }
     116        if {$name != $port} {
     117            ui_debug "Checking $port for active variants for depspec '$name'"
     118        }
     119
    107120        # this will throw if $name isn't active
    108         set installed [lindex [registry_active $name] 0]
     121        set installed [lindex [registry_active $port] 0]
    109122
    110123        # In $installed there are in order: name, version, revision, variants,
    111124        # a boolean indicating whether the port is installed and the epoch. So,
    112125        # we're interested in the field at offset 3.
    113126        set variants [lindex $installed 3]
    114         ui_debug "$name is installed with the following variants: $variants"
     127        ui_debug "$port is installed with the following variants: $variants"
    115128        ui_debug "  required: $required, forbidden: $forbidden"
    116129
    117130        # split by "+" into the separate variant names