From: Tim Orling Date: Wed, 12 Jun 2024 17:28:49 +0000 (-0700) Subject: devtool upgrade: enable RECIPE_UPDATE_EXTRA_TASKS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59894f3b5b0bc257837d7ce4ea684f1d8c382cec;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Tim Orling Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index a8130ed23f5..8e13833b51c 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -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)