Ignore:
Timestamp:
Jul 12, 2014, 5:25:17 AM (5 years ago)
Author:
sean@…
Message:

mpi-1.0: exit early when passed a removed variant

This change checks to see if a variant was passed that was explicitly banned,
e.g.

mpi.setup -openmpi

and then if a user runs 'port install gnudatalanguage +openmpi' they will now
be informed:

Error: gnudatalanguage has disallowed +openmpi! Please choose another mpi variant
Error: Unable to open port: gnudatalanguage +openmpi not allowed

This is done early so that dependencies aren't compiled with an undesired mpi.

File:
1 edited

Legend:

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

    r121953 r121954  
    205205
    206206proc mpi.setup {args} {
    207     global cdb mpidb mpi.variants mpi.require compilers.variants
     207    global cdb mpidb mpi.variants mpi.require compilers.variants name
    208208
    209209    set add_list {}
     
    257257    eval compilers.setup $cl
    258258
     259    # we need to check for a removed variant early so we can exit before
     260    # the wrong variant is passed up the dependency chain
     261    set badvariant [mpi_variant_name]
     262    set origvariants ${mpi.variants}
    259263    set mpi.variants [lsort [concat $remove_list $add_list]]
     264    set removedvariants [remove_from_list $origvariants ${mpi.variants}]
     265    if {[lsearch -exact $removedvariants $badvariant] > -1} {
     266        ui_error "$name has disallowed +$badvariant! Please choose another mpi variant"
     267        return -code error "$name +$badvariant not allowed"
     268    }
     269
    260270    eval mpi.setup_variants ${mpi.variants}
    261271
Note: See TracChangeset for help on using the changeset viewer.