[yocto] Expansion of variables inside do_package_prepend task
Joshua Watt
jpewhacker at gmail.com
Wed Feb 21 08:17:35 PST 2018
On Wed, 2018-02-21 at 16:50 +0100, Iván Castell wrote:
> Hello forum.
>
> I have a question regarding the expansion of variables in a recipe.
> Suppose I have a recipe with this "do_install" task defined:
>
> do_install() {
> BBB = ${WORKDIR}
> }
>
> Variable BBB expands to the proper working directory.
>
>
> $ bitbake -e <myrecipe> | grep BBB
> BBB = /path/to/working/directory
>
>
> However, suppose now I have a recipe with this "do_package_prepend"
> task defined:
>
> do_package_prepend() {
> AAA = ${WORKDIR}
> }
>
> Variable AAA doesn't expand to the expected working directory. In
> fact, it generates an error:
>
>
> $ bitbake -e <myrecipe> | grep AAA
> AAA = ${WORKDIR}
> ^
> SyntaxError: invalid syntax
do_package is a python function, so you prepend code must also be
python. You can do:
AAA = d.getVar('WORKDIR')
> It seems the expansion of variables is not working inside the
> do_package_prepend task. What is going wrong with that?
>
> Thank you in advance! :-)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180221/022b222b/attachment.html>
More information about the yocto
mailing list