Skip to content

Commit

Permalink
fix(bundle.bbclass): varflags expansion in python anonymous function
Browse files Browse the repository at this point in the history
Python anonymous functions are evaluated before `=` which expand
the final variable value. This fix set the `getVarFlags` kwarg `expand`
to `True` (default is `False`) to be able to assign varflag
with bitbake variable (`${...}`) or python inline syntax (`${@...})`.

Signed-off-by: Jean-Pierre Geslin <[email protected]>
  • Loading branch information
Jarsop committed Nov 8, 2023
1 parent 6c5faed commit 78e8b9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes-recipe/bundle.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ RAUC_BUNDLE_FORMAT[doc] = "Specifies the bundle format to be used (plain/verity)
python __anonymous() {
d.appendVarFlag('do_unpack', 'vardeps', ' RAUC_BUNDLE_HOOKS')
for slot in (d.getVar('RAUC_BUNDLE_SLOTS') or "").split():
slotflags = d.getVarFlags('RAUC_SLOT_%s' % slot)
# We have to expand the slotflags here as python anonymous functions
# are executed before `=` assignments are evaluated.
slotflags = d.getVarFlags('RAUC_SLOT_%s' % slot, expand=True)
imgtype = slotflags.get('type') if slotflags else None
if not imgtype:
bb.debug(1, "No [type] given for slot '%s', defaulting to 'image'" % slot)
Expand Down

0 comments on commit 78e8b9c

Please sign in to comment.