* [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs
@ 2014-03-26 9:30 Richard Purdie
2014-03-26 15:34 ` Chris Larson
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2014-03-26 9:30 UTC (permalink / raw)
To: openembedded-core
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.purdie@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))
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs
2014-03-26 9:30 [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs Richard Purdie
@ 2014-03-26 15:34 ` Chris Larson
2014-03-26 15:55 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Chris Larson @ 2014-03-26 15:34 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
On Wed, Mar 26, 2014 at 2:30 AM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> +# 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}
>
Wouldn't OE_IMPORTED := "${@oe_import(d)}" work as well, or am I missing
something?
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 962 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs
2014-03-26 15:34 ` Chris Larson
@ 2014-03-26 15:55 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2014-03-26 15:55 UTC (permalink / raw)
To: Chris Larson; +Cc: openembedded-core
On Wed, 2014-03-26 at 08:34 -0700, Chris Larson wrote:
>
> On Wed, Mar 26, 2014 at 2:30 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> +# 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}
>
> Wouldn't OE_IMPORTED := "${@oe_import(d)}" work as well, or am I
> missing something?
That would work as well. I just came to the other solution though a
different route... :)
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-26 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26 9:30 [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs Richard Purdie
2014-03-26 15:34 ` Chris Larson
2014-03-26 15:55 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox