Ignore:
Timestamp:
Oct 17, 2014, 8:18:46 PM (5 years ago)
Author:
pixilla@…
Message:

_resources/port1.0/group:

  • Add perl5.require_variant option for requiring a perl variant be selected.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/perl5-1.0.tcl

    r125708 r126930  
    7777
    7878# Set perl variant options and defaults
    79 options perl5.default_variant perl5.variant perl5.set_default_variant perl5.conflict_variants
     79options perl5.default_variant perl5.variant perl5.set_default_variant perl5.conflict_variants perl5.require_variant
    8080default perl5.default_variant [string map {. _} perl${perl5.default_branch}]
    8181default perl5.variant {[string map {. _} perl${perl5.major}]}
    8282default perl5.set_default_variant {true}
    8383default perl5.conflict_variants {true}
     84default perl5.require_variant {false}
    8485# Get variant names from branches
    8586proc perl5.get_variant_names {branches} {
     
    9293# Create perl variants
    9394proc perl5.create_variants {branches} {
    94     global perl5.major perl5.default_variant perl5.variant perl5.set_default_variant perl5.conflict_variants
     95    global name perl5.major perl5.default_variant perl5.variant perl5.set_default_variant perl5.conflict_variants perl5.require_variant
    9596    set variants [perl5.get_variant_names ${branches}]
    9697    foreach branch ${branches} {
     
    110111    if {${perl5.default_variant} eq ${perl5.variant} && ${perl5.set_default_variant}} {
    111112        default_variants-append +${perl5.variant}
     113    }
     114# Require perl variant
     115    if {![variant_isset ${perl5.variant}] && ${perl5.require_variant}} {
     116        ui_error "${name} requires one of these variants: ${variants}"
     117        return -code error "absence of required perl variant"
    112118    }
    113119# Set perl version and deps
Note: See TracChangeset for help on using the changeset viewer.