summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/devtool3
-rw-r--r--scripts/lib/scriptutils.py8
2 files changed, 8 insertions, 3 deletions
diff --git a/scripts/devtool b/scripts/devtool
index 0c32c502a3..219749365c 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -294,7 +294,8 @@ def main():
294 finally: 294 finally:
295 tinfoil.shutdown() 295 tinfoil.shutdown()
296 296
297 for path in [scripts_path] + global_args.bbpath.split(':'): 297 # Search BBPATH first to allow layers to override plugins in scripts_path
298 for path in global_args.bbpath.split(':') + [scripts_path]:
298 pluginpath = os.path.join(path, 'lib', 'devtool') 299 pluginpath = os.path.join(path, 'lib', 'devtool')
299 scriptutils.load_plugins(logger, plugins, pluginpath) 300 scriptutils.load_plugins(logger, plugins, pluginpath)
300 301
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 5ccc027968..27d82b62b8 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -52,10 +52,14 @@ def load_plugins(logger, plugins, pluginpath):
52 if fp: 52 if fp:
53 fp.close() 53 fp.close()
54 54
55 def plugin_name(filename):
56 return os.path.splitext(os.path.basename(filename))[0]
57
58 known_plugins = [plugin_name(p.__name__) for p in plugins]
55 logger.debug('Loading plugins from %s...' % pluginpath) 59 logger.debug('Loading plugins from %s...' % pluginpath)
56 for fn in glob.glob(os.path.join(pluginpath, '*.py')): 60 for fn in glob.glob(os.path.join(pluginpath, '*.py')):
57 name = os.path.splitext(os.path.basename(fn))[0] 61 name = plugin_name(fn)
58 if name != '__init__': 62 if name != '__init__' and name not in known_plugins:
59 plugin = load_plugin(name) 63 plugin = load_plugin(name)
60 if hasattr(plugin, 'plugin_init'): 64 if hasattr(plugin, 'plugin_init'):
61 plugin.plugin_init(plugins) 65 plugin.plugin_init(plugins)