[bitbake-devel] when does ${XX} in variable names get expanded?
Richard Purdie
richard.purdie at linuxfoundation.org
Thu Aug 4 09:48:53 UTC 2011
On Thu, 2011-08-04 at 17:19 +0800, Lu, Lianhao wrote:
> For the following variable definition in bitbake,
>
> VVV = "llu"
> A_${VVV} = "VVV"
> A_llu = "llu"
>
> B = "${@bb.data.getVar('A_llu', d, True)}"
> C := "${@bb.data.getVar('A_llu', d, True)}"
>
> Why B is "VVV" and C is "llu" in final? I'm wondering when is the ${VVV} in the variable name of A_${VVV} expanded.
During finalise() there is a call to d.expandKeys(). That call will
cause A_${VVV} to overwrite A_llu. If you look at the variable before
that you will get one value, if you look at it after that you will see
the other.
In your example above := is the immediate assignment/expansion operator,
"immediate" being the key part so finalise() hasn't happened yet.
Cheers,
Richard
More information about the bitbake-devel
mailing list