From: Alexander Kanavin <[email protected]>

This is modeled on RECIPE_UPGRADE_EXTRA_TASKS with the difference
being that the tasks run in 'devtool finish', and only when
finishing an upgrade operation. This allows recipes to define
custom operations, such as renaming additional supplementary
recipes (such as *-initial, *-native etc), or any other custom
handling that devtool cannot know about.

The idea is to teach glib, cmake, mesa, systemd, libva, rt-tests,
go, rust, etc etc about upgrading themselves properly with this,
improving success rates in AUH.

Signed-off-by: Alexander Kanavin <[email protected]>
---
 scripts/lib/devtool/standard.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 1d0fe137887..d22bfe8e4a9 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -2088,7 +2088,6 @@ def _get_layer(layername, d):
         logger.warning("Consider using path instead of base name to specify 
layer:\n\t\t%s" % '\n\t\t'.join(layer_paths))
         return os.path.abspath(layer_paths[0])
 
-
 def finish(args, config, basepath, workspace):
     """Entry point for the devtool 'finish' subcommand"""
     import bb
@@ -2120,6 +2119,7 @@ def finish(args, config, basepath, workspace):
 
         destlayerdir = _get_layer(args.destination, tinfoil.config_data)
         recipefile = rd.getVar('FILE')
+        upgrade_finish_tasks = (rd.getVar('RECIPE_UPGRADE_FINISH_EXTRA_TASKS') 
or '').split()
         recipedir = os.path.dirname(recipefile)
         origlayerdir = oe.recipeutils.find_layerdir(recipefile)
 
@@ -2265,6 +2265,9 @@ def finish(args, config, basepath, workspace):
     else:
         _reset([args.recipename], no_clean=no_clean, remove_work=remove_work, 
config=config, basepath=basepath, workspace=workspace)
 
+        if removing_original:
+            for t in upgrade_finish_tasks:
+                exec_build_env_command(config.init_path, basepath, 'bitbake -c 
{} {}'.format(t, args.recipename))
     return 0
 
 
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#201007): 
https://lists.openembedded.org/g/openembedded-core/message/201007
Mute This Topic: https://lists.openembedded.org/mt/106796297/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to