[OE-core] subtle weirdness when you combine "_append" with "+="?

Robert P. J. Day rpjday at crashcourse.ca
Wed Aug 17 13:21:15 UTC 2016


On Tue, 16 Aug 2016, Khem Raj wrote:

  ... big snip ...

> the _append/_prepend in conjunction with += is a undocumented
> behavior however, I do not see it as much a side effect. But in
> future bitbake may silently change its behavior, so I agree its
> always good to stay in safe waters.

  so just to finalize this discussion, my thoughts on a reasonable and
meaningful standard for append/prepend/etc/etc would be to *always*
use the "mathematical" operators +=/.=/=+/=. except in two situations:

  1) when parsing *must* be delayed until the end, or
  2) when combining the operation with an override (for which i'm
     quite sure there is no equivalent when using +=, etc, right?)

i'm a big fan of simplicity, in the sense that, if an append operation
does not *require* "_append", it shouldn't use it. because if i see an
expression:

  VAR_append = "..."

then i immediately wonder if there is a *reason* for using "_append"
rather than "+=" or ".=", or if that is just the developer's personal
preference. and i really, really, really hate having to guess.

  oh, and of course, never, ever combine "_append" with "+=" or ".=".
does that sound like a reasonable coding style?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================





More information about the Openembedded-core mailing list