'require' statement and bbappend
I have a recipe that I want to extend through a .bbappend file. The recipe contains a line that says,
require linux-imx-src-${PV}.inc
Now my .bbappend file changes PV like so:
PV = "4.14.98-git${SRCPV}"
Contrary to what I would have expected, this does not result in a parsing error. I am totally fine with this, as it is exactly what I want. It only bothers me that I do not understand what is going on...
Quoted 8 lines · On Fri, 2020-03-06 at 01:34 -0800, [email protected] wrote:
I have a recipe that I want to extend through a .bbappend file. The recipe contains a line that says,
require linux-imx-src-${PV}.inc
Now my .bbappend file changes PV like so:
PV = "4.14.98-git${SRCPV}"
In order to parse, bitbake has to immediately expand PV at that point in parsing. Its like writing:
REQUIRE_FILE := "linux-imx-src-${PV}.inc"
require ${REQUIRE_FILE}
if that helps explain it?
The parser has to know the value of PV there at that point in time.
Cheers,
Richard
1) w.r.t ".. The recipe contains a line that says, require linux-imx-src-${PV}.inc " By this the recipe ensure's that we get an error if the ".inc" file is not there . As this is better than allowing it to process ahead for case where we have absence of said file .
2) w.r.t " PV = "4.14.98-git${SRCPV}"
It helps in cases where we can have SRCREV = "${AUTOREV}".
Even if we dont have SRCREV = "${AUTOREV}" , by adding git${SRCPV} we are able to track git version and what's the SHA or commit-id for said repo
Hope it helps .
Thanks
Ashish