[rtems_waf PATCH] rtems: Allow checking multiple environment variable

Chris Johns chrisj at rtems.org
Wed Mar 18 04:53:01 UTC 2020


Hi,

Nice change, I have pushed this.

Chris

On 17/3/20 8:52 pm, Vijay Kumar Banerjee wrote:
> ---
>  rtems.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/rtems.py b/rtems.py
> index 6dd71b1..ceabcd9 100644
> --- a/rtems.py
> +++ b/rtems.py
> @@ -479,10 +479,11 @@ def check_options(ctx, prefix, rtems_tools, rtems_path, rtems_version, rtems_arc
>  
>      return rtems_version, rtems_path, tools, archs, arch_bsps
>  
> -def check_env(ctx, var):
> -    if var in ctx.env and len(ctx.env[var]) != 0:
> -        return True
> -    return False
> +def check_env(ctx, *env_vars):
> +    for v in env_vars:
> +        if v not in ctx.env or len(ctx.env[v]) == 0:
> +            return False
> +    return True
>  
>  def check(ctx, option, setting = 'Yes'):
>      if option in ctx.env:
> 


More information about the devel mailing list