declaring variants/subports in loops and loop variables

René J.V. Bertin rjvbertin at gmail.com
Wed Dec 7 17:14:44 CET 2016


On Wednesday December 07 2016 10:07:31 Ryan Schmidt wrote:

Hi,


> The boost port shows a typical example of using "eval" and "subst" to ensure the variable values are substituted immediately.

In a nutshell, put the whole block where you want to force using the current values of all variables inside the curly braces of

eval [subst {}]

That seems to do the trick all right. I was a bit hoping for a `foreach` option to make limit the scope of the loop variable and all variables declared inside the loop, but that would probably be much more complicated to implement.

Is this the "strongly preferred" way or is it just as fine to use `if {[variant_isset xx]}` or `if {${subport} eq ...}`?

R.


More information about the macports-dev mailing list