a question about recipe style
perusing the bitbake user manual, and ran across the section
discussing the "override style" operators _append, _prepend and _remove, and thought i'd go looking through the OE recipes for an actual example of the use of "_remove", and the only example i found is in meta/recipes-extended/newt, but it looks a bit awkward, so i just want to know about recommended style.
there are two recipe files there -- libnewt_0.52.17.bb and
libnewt-python_0.52.17.bb -- with the following structure. that first recipe file contains (among other things) the following:
PACKAGES_prepend = "whiptail "
...FILES_whiptail = "${bindir}/whiptail"
ok, so that recipe defines an additional package, and adds a single
file to that package, whereupon the second recipe file contains:
require recipes-extended/newt/libnewt_${PV}.bb
...PACKAGES_remove = "whiptail"
it just seems awkward for recipe 1 to explicitly add a package, only
for recipe 2 to include that recipe file, and subsequently remove that package.
it's not a big deal, but from a style perspective, i would have
thought one would first create a generic libnewt.inc file with common content, then define the two recipe files off of that. does that make sense in terms of best programming principles?
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================Quoted 22 lines · Robert P. J. Day
perusing the bitbake user manual, and ran across the section
discussing the "override style" operators_append,_prependand_remove, and thought i'd go looking through the OE recipes for an actual example of the use of "_remove", and the only example i found is in meta/recipes-extended/newt, but it looks a bit awkward, so i just want to know about recommended style.there are two recipe files there -- libnewt_0.52.17.bb and
libnewt-python_0.52.17.bb -- with the following structure. that first recipe file contains (among other things) the following:
PACKAGES_prepend= "whiptail "
...FILES_whiptail= "${bindir}/whiptail"ok, so that recipe defines an additional package, and adds a single
file to that package, whereupon the second recipe file contains:require recipes-extended/newt/libnewt_${PV}.bb
...PACKAGES_remove= "whiptail"
Quoted 8 lines
it just seems awkward for recipe 1 to explicitly add a package, only
for recipe 2 to include that recipe file, and subsequently remove that package.it's not a big deal, but from a style perspective, i would have
thought one would first create a generic libnewt.inc file with common content, then define the two recipe files off of that. does that make sense in terms of best programming principles?
Yes, it does seem like an odd way to have written the recipes. I'd be happy enough to see some cleanup patches...
Cheers,
Richard
Quoted 27 lines · Richard Purdie
Quoted 26 lines · Robert P. J. Day
perusing the bitbake user manual, and ran across the section
discussing the "override style" operators_append,_prependand_remove, and thought i'd go looking through the OE recipes for an actual example of the use of "_remove", and the only example i found is in meta/recipes-extended/newt, but it looks a bit awkward, so i just want to know about recommended style.there are two recipe files there -- libnewt_0.52.17.bb and
libnewt-python_0.52.17.bb -- with the following structure. that first recipe file contains (among other things) the following:
PACKAGES_prepend= "whiptail "
...FILES_whiptail= "${bindir}/whiptail"ok, so that recipe defines an additional package, and adds a single
file to that package, whereupon the second recipe file contains:require recipes-extended/newt/libnewt_${PV}.bb
...PACKAGES_remove= "whiptail"it just seems awkward for recipe 1 to explicitly add a package, only
for recipe 2 to include that recipe file, and subsequently remove that package.
Quoted 7 lines
Quoted 4 lines
it's not a big deal, but from a style perspective, i would have
thought one would first create a generic libnewt.inc file with common content, then define the two recipe files off of that. does that make sense in terms of best programming principles?Yes, it does seem like an odd way to have written the recipes. I'd be happy enough to see some cleanup patches...
maybe i'll give that as an assignment to my students. :-) that
oddity clearly isn't a big deal since it works just fine, i just thought it looked strange enough that i wanted to make sure there wasn't something subtle going on i didn't understand.
movin' on ...
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================