<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 7:19 AM, Ola x Nilsson <span dir="ltr"><<a href="mailto:ola.x.nilsson@axis.com" target="_blank">ola.x.nilsson@axis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":sd" class="a3s aXjCH m157af02d5cc4af2f">When a devtool plugin is shadowed in a higher-priorty layer the<br>
register_commands method was called on the shadowing plugin once for<br>
each found plugin with that name. A simple unique operation on the list<br>
of loaded plugins solves that problem. It may still be a problem that<br>
each plugin - shadowed or not - is loaded and initialized.<br>
<br>
Signed-off-by: Ola x Nilsson <<a href="mailto:ola.x.nilsson@axis.com">ola.x.nilsson@axis.com</a>><br>
---<br>
scripts/devtool | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/scripts/devtool b/scripts/devtool<br>
index 0c32c50..7b134a6 100755<br>
--- a/scripts/devtool<br>
+++ b/scripts/devtool<br>
@@ -317,7 +317,7 @@ def main():<br>
parser_create_workspace.add_<wbr>argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration')<br>
parser_create_workspace.set_<wbr>defaults(func=create_<wbr>workspace, no_workspace=True)<br>
<br>
- for plugin in plugins:<br>
+ for plugin in set(plugins):<br>
if hasattr(plugin, 'register_commands'):<br>
plugin.register_commands(<wbr>subparsers, context)</div></blockquote></div><br>This is directly comparing the plugin modules or classes, which, if there’s shadowing going on, will almost certainly be different, and we’ll still end up with the same commands registered multiple times. And of course, use of set will also change the plugin command registration order. If we’re going to ignore commands on some of the plugins, it should have avoided loading them entirely, not load them and then prevent registration. We should change the plugin *loading* to only load the highest priority (first seen in bbpath) file for a given .py, based on the file / module name, IMO.<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>