]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: Run oe_import before other INHERITs
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 26 Mar 2014 09:30:33 +0000 (09:30 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Mar 2014 09:39:37 +0000 (09:39 +0000)
Its possible for classes listed in INHERIT directives to use things like
the oe.utils functions. If that happens the user sees a traceback since
the modules don't become available until the ConfigParsed event.

This change to use immediate expansion means that the oe modules become available
much sooner and can be used in the core classes, including within base.bbclass.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass

index 76a4ef650d767cc931beac093c67b03b8c803561..7c39db915773c4e75f7cc50d36c8519df789ad3b 100644 (file)
@@ -31,8 +31,12 @@ def oe_import(d):
         imported = __import__(toimport)
         inject(toimport.split(".", 1)[0], imported)
 
+    return ""
+
+# We need the oe module name space early (before INHERITs get added)
+OE_IMPORTED := "${@oe_import(d)}"
+
 python oe_import_eh () {
-    oe_import(e.data)
     e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
 }