On 2013-7-10 03:56 , Clemens Lang wrote:
> On Tue, Jul 09, 2013 at 07:32:03PM +0200, Gustaf Neumann wrote:
>> foreach {foo.version foo.string} ${foo.versions} {
>>     subport foo-${foo.version} [subst {
>>         pre-fetch {
>>             system "echo ${foo.version}"
>>         }
>>         fetch {}
>>         extract {}
>>         use_configure no
>>         build {}
>>         destroot {}
>>     }]
>> }
> 
> I assume there is no sane way to guess what the user wants and somehow
> integrate this into the subport (and pre-fetch, etc.) procs, is there?
> 
> We could have a -subst switch, though:
>   subport -subst {
>     code
>   }

No need for that; using quotes instead of braces will achieve the same
thing. The trouble comes of course if you want to substitute some
variables at definition time and others at runtime (or at the top level
of the subport but not inside the pre-fetch or other internal
brace-wrapped string). I guess you could use 'format' on the body.

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

Reply via email to