>>>>> On Thu, 20 Jul 2023, Mike Gilbert wrote:

> On Thu, Jul 20, 2023 at 11:06 AM Florian Schmaus <f...@gentoo.org> wrote:
>> While the bash language has no boolean datatype, you can exploit the
>> fact that 'true' and 'false' are usually shell builtins:
>> 
>> : "${MESON_VERBOSE:=true}"
>> 
>> and then later
>> 
>> if $MESON_VERBOSE; then
>> mesoncompileargs+=( --verbose )
>> fi

> I think we generally try to avoid exploiting that behavior in ebuilds.
> It's usually much more obvious to check for a non-empty string, or for
> a specific value.

Testing for a non-empty variable is also faster than executing "true"
or "false" builtins from variable values. (Which doesn't play any role
here, but readability of the code does.)

Attachment: signature.asc
Description: PGP signature

Reply via email to