variants vs separate ports

Daniel J. Luke dluke at geeklair.net
Mon May 24 10:38:50 PDT 2010


On May 24, 2010, at 1:30 PM, Ryan Schmidt wrote:
> GraphicsMagick uses:
> 
> if {![variant_isset q16] && ![variant_isset q32]} {
>    default_variants +q8
> }
> 
> This ensures that if the user does not specify +q8, +q16 or +q32, it selects +q8. 
> 
> The one thing this does not handle is if the user specifically tries to install "GraphicsMagick -q8"; in this case no variant will be selected. I've never been entirely comfortable with that. Perhaps we should indeed be using variant_set instead:
> 
> if {![variant_isset q16] && ![variant_isset q32]} {
>    variant_set q8
> }
> 
> I'm not certain why we haven't been doing that.

I still don't understand why you set up some of your ports this way instead of the more straightforward method (have the +q8 configure args in the default configure args, and have the variants just remove the +q8 stuff and add their appropriate args).

To me, Portfiles are always clearer if they can avoid using variant_isset.

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+





More information about the macports-dev mailing list