devtool upgrade: enable RECIPE_UPDATE_EXTRA_TASKS

For some recipes, such as those that inherit cargo-update-recipe-crates,
we need to run additional tasks once the new sources have been unpacked.

Introduce a new variable RECIPE_UPDATE_EXTRA_TASKS which is a space-
delimited list of tasks to run after the new sources have been
unpacked in scripts/lib/devtool/upgrade.py ugrade() method.

(From OE-Core rev: 59894f3b5b0bc257837d7ce4ea684f1d8c382cec)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Tim Orling 2024-06-12 10:28:49 -07:00 committed by Richard Purdie
parent ddc86a93da
commit 82d07928fe

View File

@ -534,6 +534,15 @@ def _generate_license_diff(old_licenses, new_licenses):
diff = diff + line
return diff
def _run_recipe_update_extra_tasks(pn, rd, tinfoil):
tasks = []
for task in (rd.getVar('RECIPE_UPDATE_EXTRA_TASKS') or '').split():
logger.info('Running extra recipe update task: %s' % task)
res = tinfoil.build_targets(pn, task, handle_events=True)
if not res:
raise DevtoolError('Running extra recipe update task %s for %s failed' % (task, pn))
def upgrade(args, config, basepath, workspace):
"""Entry point for the devtool 'upgrade' subcommand"""
@ -609,6 +618,8 @@ def upgrade(args, config, basepath, workspace):
copied, config.workspace_path, rd)
standard._add_md5(config, pn, af)
_run_recipe_update_extra_tasks(pn, rd, tinfoil)
update_unlockedsigs(basepath, workspace, args.fixed_setup, [pn])
logger.info('Upgraded source extracted to %s' % srctree)