suggestion for Fortran recipe

David Strubbe dstrubbe at mit.edu
Thu Oct 3 18:47:08 PDT 2013


Hi Jeremy and others,

I think a few lines can be simplified in the new Fortran recipe. For
default variants, it seems to me that it makes no difference whether it is
set when the variant was explicitly selected.

i.e this code from the Portfile recipe

if {![variant_isset q8] && ![variant_isset q32]} {
    default_variants +q16
}

is functionally equivalent to


if {![variant_isset q8] && ![variant_isset q16] && ![variant_isset q32]} {
    default_variants +q16
}

since if +q16 is selected it is not important whether we consider that
choice to have been made by default or not.

As a result, in the Fortran recipe,

    if {[variant_isset gcc${ver_no_dot}]} {
        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
            set default_fortran_variant ""
        }
    }

is equivalent in functionality to

    if {[variant_isset gcc${ver_no_dot}]} {
        set default_fortran_variant ""
    }

and the corresponding if-condition can be removed in the g95 statement,
thus removing some lines and simplifying it.

I am also wondering, can't the Fortran recipe be made a PortGroup? It seems
problematic for the maintainability of the portfiles for there to be such a
large block duplicated in many portfiles. If it were a PortGroup, then
issues like the one above could be settled centrally.

Best,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20131003/bafe6cd5/attachment.html>


More information about the macports-dev mailing list