[oe] Add bb.data.flagAppend

Richard Purdie rpurdie at rpsys.net
Thu Aug 5 11:10:23 UTC 2010


I've been wondering what we could do to get rid of clutter in some of
our class files. One thing we see a lot of is getting a flag, appending
to it and saving it again. In normal syntax, =+ works great for this but
that doesn't help in anonymous python. We see lots of things like:

deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split()
deps.append('opkg-utils-native:do_populate_sysroot')
deps.append('virtual/fakeroot-native:do_populate_sysroot')
bb.data.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps), d)

where as it would be nice just to be able to write:

bb.data.varFlagAppend('do_package_write_ipk', 'depends', "opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot", d)

or

deps = "opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot"
bb.data.varFlagAppend('do_package_write_ipk', 'depends', deps, d)

if long lines make you uneasy.

Does anyone else feel such a function would be of use? It would assume
space delimitation as the "=+" and "+=" operators work. 

Cheers,

Richard





More information about the Openembedded-devel mailing list