[oe] [RFC] base_less_or_equal() for numerical value testing in OE

Paul Sokolovsky pmiscml at gmail.com
Tue Feb 27 20:35:00 UTC 2007


Hello openembedded-devel,

  OE has base_conditional() function which is kind of C's ternary ?:
operator, with equality of two value as a condition (it is a bit
misnamed in this respect, it'd rather be base_equals() ).

  There're few other such conditional functions, for example for set
containment check. What we lack however is simple numeric less/greater
check. Having it would be important for us to continue started work of
using generalized machine feature checks to decide on some aspects of
image/package building, instead of hardcoding tests for specific
machines.

  So, hitting such need yet another time, I proceeded to add
base_less_or_equal() to base.bbclass, and used it to tweak locale
package install for Angstrom:

# Also, it appears that no locales fit in 16Mb for now. "C" locale rules!
IMAGE_LINGUAS = '${@base_less_or_equal("ROOT_FLASH_SIZE", "16", "", "en-gb", d)}'

  This shows common usecase, and makes clear why exactly
base_less_or_equal() was added - I don't have a usecase for
base_less() now at all.


  This code was committed, as it doesn't affect any existing aspect of
OE. Please feel free to tweak it, and of course use!


-- 
Best regards,
 Paul                          mailto:pmiscml at gmail.com





More information about the Openembedded-devel mailing list