diff mbox series

[v9,2/9] devtool: support plugins with plugins

Message ID 20240114221437.1255866-3-adrian.freihofer@siemens.com
State New
Headers show
Series devtool ide plugin | expand

Commit Message

Adrian Freihofer Jan. 14, 2024, 10:14 p.m. UTC
Pass the plugins search path to plugins via context. This allows plugins
to search for their own plugins at the same paths.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 scripts/devtool | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/devtool b/scripts/devtool
index 3aae7b93b4b..60ea3e82985 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -299,8 +299,9 @@  def main():
             return 2
 
     # Search BBPATH first to allow layers to override plugins in scripts_path
-    for path in global_args.bbpath.split(':') + [scripts_path]:
-        pluginpath = os.path.join(path, 'lib', 'devtool')
+    pluginpaths = [os.path.join(path, 'lib', 'devtool') for path in global_args.bbpath.split(':') + [scripts_path]]
+    context.pluginpaths = pluginpaths
+    for pluginpath in pluginpaths:
         scriptutils.load_plugins(logger, plugins, pluginpath)
 
     subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')