Guide should warn about default_variants

markd at macports.org markd at macports.org
Sat Mar 29 22:13:39 PDT 2008


>The guide says this about default_variants:
>
>>     If variants are defined, then the default_variants value lists
>> which variants are enabled by default. This allows for Portfile
>> modularity and also allows users to suppress default variants if
>> they wish.
>>
>>         * Default: none
>>         * Example: default_variants +ssl +tcpd
>>
>>     Default variants may be suppressed by preceding a variant name
>> with a "-" as shown in this example.
>>
>>     %% port install foo -ssl
>
>A MacPorts bug makes default_variants inadvisable to use for variants
>that you might conceivably want to disable. (If, as in the example
>above, you "port install foo -ssl", foo -ssl is installed. But when
>you later need to upgrade foo, default_variants +ssl will take
>precedence and you'll be left with just "foo" (no "-ssl") installed.)
>Therefore, this section should add a note like this:
>
>
>"The use of default_variants is discouraged. Instead, it's recommend
>that a port be built such that the most commonly requested
>functionality is on, and if needed, can be disabled with a
>"+no_something" variant. To extend the above example, build the port
>so that ssl and tcpd functionality is on, without needing to select
>any variant. Provide "no_ssl" and "no_tcpd" variants if there's a
>good reason someone might want to disable those features."

Is this still the best advice on default variants?  I recalled (or so I
thought) of a distant thread that had recommended them, so I have a few
ports that use them.  Is this view stated here the consensus view now?  I
just want to be sure.  Also, is the bug referred to in v1.6 (still a bug)
for ports that still use default variants?

Mark



More information about the macports-dev mailing list