When creating a recipe there can be cases where there is a class that
does some of the recipe creation (such as cargo-update-recipe-crates).
To avoid duplication of code, look for run_task assignments in the
extravalues dictionary returned by the handler, and if it is set then
call that task after writing the recipe.
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
extrafiles = extravalues.pop('extrafiles', {})
extra_pn = extravalues.pop('PN', None)
extra_pv = extravalues.pop('PV', None)
+ run_tasks = extravalues.pop('run_tasks', "").split()
if extra_pv and not realpv:
realpv = extra_pv
log_info_cond('Recipe %s has been created; further editing may be required to make it fully functional' % outfile, args.devtool)
tinfoil.modified_files()
+ for task in run_tasks:
+ logger.info("Running task %s" % task)
+ tinfoil.build_file_sync(outfile, task)
+
if tempsrc:
if args.keep_temp:
logger.info('Preserving temporary directory %s' % tempsrc)