[121954] trunk/dports/_resources/port1.0/group/mpi-1.0.tcl

sean at macports.org sean at macports.org
Fri Jul 11 22:25:17 PDT 2014


Revision: 121954
          https://trac.macports.org/changeset/121954
Author:   sean at macports.org
Date:     2014-07-11 22:25:17 -0700 (Fri, 11 Jul 2014)
Log 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.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/mpi-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/mpi-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/mpi-1.0.tcl	2014-07-12 05:25:10 UTC (rev 121953)
+++ trunk/dports/_resources/port1.0/group/mpi-1.0.tcl	2014-07-12 05:25:17 UTC (rev 121954)
@@ -204,7 +204,7 @@
 }
 
 proc mpi.setup {args} {
-    global cdb mpidb mpi.variants mpi.require compilers.variants
+    global cdb mpidb mpi.variants mpi.require compilers.variants name
 
     set add_list {}
     set remove_list ${mpi.variants}
@@ -256,7 +256,17 @@
     # variants to detect an incompatibility
     eval compilers.setup $cl
 
+    # we need to check for a removed variant early so we can exit before
+    # the wrong variant is passed up the dependency chain
+    set badvariant [mpi_variant_name]
+    set origvariants ${mpi.variants}
     set mpi.variants [lsort [concat $remove_list $add_list]]
+    set removedvariants [remove_from_list $origvariants ${mpi.variants}]
+    if {[lsearch -exact $removedvariants $badvariant] > -1} {
+        ui_error "$name has disallowed +$badvariant! Please choose another mpi variant"
+        return -code error "$name +$badvariant not allowed"
+    }
+
     eval mpi.setup_variants ${mpi.variants}
 
     set mpi [ mpi_variant_name ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140711/906e5f6f/attachment-0001.html>


More information about the macports-changes mailing list