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.

Whilst rather ugly, this change 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.pur...@linuxfoundation.org>
---
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 76a4ef6..f085173 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -31,8 +31,14 @@ 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)
+# and whilst ugly, abusing inherit like this is quite effective
+BASEIMPORTS = "${@oe_import(d)}"
+inherit ${BASEIMPORTS}
+
 python oe_import_eh () {
-    oe_import(e.data)
     e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
 }
 


-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to