{#- prologue -#} {%- set penv = [] -%} {%- if cfg.preserve_env -%} {%- set penv = cfg.preserve_env -%} {%- if penv is string -%} {%- set penv = [penv] -%} {%- elif penv is iterable -%} {#- {%- set penv = penv -%} -#} {%- else -%} {%- set penv = [penv|string()] -%} {%- endif -%} {%- endif -%} {%- set have = namespace() -%} {%- set have.tz = false -%} {%- set have.malloc_arena = false -%} {#- scan -#} {%- for v in penv -%} {%- set have.tz = have.tz or re.match('TZ(=|$)', v|string()) -%} {%- set have.malloc_arena = have.malloc_arena or re.match('MALLOC_ARENA_MAX(=|$)', v|string()) -%} {%- endfor -%} {#- main part -#} {%- if not have.tz -%} env TZ; {% endif %} {%- if not have.malloc_arena -%} env MALLOC_ARENA_MAX; {% endif %} {%- for v in penv -%} {%- if re.search("(\"|'|\\s)", v|string()) %} env {{ (v|string()).__repr__() }}; {%- else %} env {{ v }}; {%- endif %} {%- endfor -%}