[bitbake-devel] [PATCH] bitbake: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)

Andreas Oberritter obi at opendreambox.org
Mon Mar 5 12:16:10 UTC 2012


On 04.03.2012 04:59, Richard Purdie wrote:
> Using "1" with getVar is bad coding style and "True" is preferred.

Slightly OT, but wouldn't it be more convenient, especially for external
callers like OE, to make True the default for getVar? This would also
make getVar somehow more symmetric to setVar.

A rough, inexact comparison between usage of True vs. False [1]:

bitbake: 214 times True, 25 times False
openembedded-core: 1143 times True, 49 times False
meta-openembedded: 93 times True, 1 time False

Regards,
Andreas

[1]: Method used to obtain the numbers:
git grep '\<getVar\>\s*([^)]\+,\s*\(True\|1\)\s*)' | wc -l
git grep '\<getVar\>\s*([^)]\+,\s*\(False\|0\)\s*)' | wc -l




More information about the bitbake-devel mailing list