[PATCH v2] wscript: Allow substitution outside values

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Apr 14 06:18:59 UTC 2022


On 13/04/2022 23:47, Kinsey Moore wrote:
> This expands the ability to substitute variables outside the current
> limitation of values in options to asflags, cflags, cppflags, cxxflags,
> ldflags, and includes. It is possible for all of these flags to utilize
> user-defined information in config.ini, especially for paths to external
> resources.

Thanks, the patch is fine with one change...

> ---
>   wscript | 54 ++++++++++++++++++++++++++++--------------------------
>   1 file changed, 28 insertions(+), 26 deletions(-)
> 
> diff --git a/wscript b/wscript
> index 4d63dbc66f..eb5761c53d 100755
> --- a/wscript
> +++ b/wscript
> @@ -239,6 +239,8 @@ class Item(object):
>           return
>   
>       def substitute(self, ctx, value):
> +        if isinstance(value, list):
> +            return [self.substitute(ctx, subvalue) for subvalue in value]
>           if isinstance(value, str):
>               try:
>                   return Template(value).substitute(EnvWrapper(ctx.env))

Please move the if list after the if str, since if str is more likely.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list