◐ Shell
clean mode source ↗

Message 407981 - Python tracker

Quoting msg407949:
> [...] We should do something like
>
>   ZLIB_CFLAGS=${ZLIB_CFLAGS:-""}
>   ZLIB_LIBS=${ZLIB_LIBS:-"-lz"}
>
> for all env vars.

I think we should use ${VAR-default} instead of ${VAR:-default}; we only want to override if the variable is _not_ set:

    $ TEST=
    $ echo ${TEST-default}
    
    $ echo ${TEST:-default}
    default
    $ unset TEST
    $ echo ${TEST-default} 
    default
    $ echo ${TEST:-default}
    default


> I prefer the syntax over ${ZLIB_CFLAGS:=""} because it is more obvious what
> is happening.

I agree. I also prefer `TEST=${TEST-""}` to `TEST=${TEST-}` for empty strings.