On Jan 6, 2013, at 12:04, Bradley Giesbrecht <[email protected]> wrote:

> On Jan 6, 2013, at 9:55 AM, [email protected] wrote:
> 
>> variant gpl3 description {Merge in changes from gcc-4.2.4} {
>> 
>>      license         GPL-3
>> 
>> -    set gcc_version 4.2.4
>> 
>>      maintainers     googlemail.com:tobias.netzel openmaintainer
>> 
>> 
>> 
>>      patchfiles-append    gcc-4.2.1-4.2.4.patch
>> 
>> }
>> 
>> +if {[variant_isset gpl3]} {
>> +    set gcc_version 4.2.4
>> +}
> 
> 
> Why does setting vars inside variant blocks not always work?
> Is the variant block NOT parsed in each phase?

The main part of the portfile is parsed, and then afterward, the variants are 
parsed. So the variable was not being set to its new value until after 
master_sites had already been set using the variable's old value.

Platform blocks used to behave this way too, but that was changed a few 
versions of MacPorts ago. Now platform blocks are equivalent to "if" statements.

_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to