[oe-commits] Richard Purdie : base.bbclass: Run oe_import before other INHERITs

git at git.openembedded.org git at git.openembedded.org
Thu Mar 27 09:36:07 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: a9ecad713f37f2703e99c6b856207abeb6c5ad1f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a9ecad713f37f2703e99c6b856207abeb6c5ad1f

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Wed Mar 26 09:30:33 2014 +0000

base.bbclass: Run oe_import before other INHERITs

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 at linuxfoundation.org>

---

 meta/classes/base.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 76a4ef6..7c39db9 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -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))
 }
 



More information about the Openembedded-commits mailing list