[OE-core] style suggestions for that whole "_append" and leading space thing

Robert P. J. Day rpjday at crashcourse.ca
Mon Feb 27 11:07:54 UTC 2017


  getting pedantic (as i am wont to do), occasionally i run across
things like this, from meta/conf/distro/include/no-static-libs.inc:

  EXTRA_OECONF_append = "${DISABLE_STATIC}"

which, at first glance, simply seems wrong given the lack of a leading
space, until one looks higher up in that same file to read:

  DISABLE_STATIC = " --disable-static"

where one finds the leading space as part of the variable itself. i
find this potentially *really* confusing; consistent style suggests
variables should be assigned their values without regard as to how
they might be used later. subsequent references or usages of those
variables should be responsible for making sure they're included
properly, no?

  and the last line in that same file also suggests potential misuse:

  EXTRA_OECMAKE_append_pn-libical = "-DSHARED_ONLY=True"

rday

p.s. would the same logic hold with lines like this?

meta/conf/machine/include/tune-ppce6500.inc:

  MACHINE_FEATURES_BACKFILL_CONSIDERED_append =
     "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"

would it not be clearer if one were to write:

  MACHINE_FEATURES_BACKFILL_CONSIDERED_append =
     " ${@bb.utils.contains('TUNE_FEATURES', 'e6500', 'qemu-usermode', '', d)}"





More information about the Openembedded-core mailing list