From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (dan.rpsys.net [93.97.175.187]) by mail.openembedded.org (Postfix) with ESMTP id 548236F90E for ; Wed, 26 Mar 2014 09:30:49 +0000 (UTC) Received: from localhost (dan.rpsys.net [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu4) with ESMTP id s2Q9UimP005714 for ; Wed, 26 Mar 2014 09:30:44 GMT X-Virus-Scanned: Debian amavisd-new at dan.rpsys.net Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8xcgZtQDhjQo for ; Wed, 26 Mar 2014 09:30:44 +0000 (GMT) Received: from [192.168.3.10] (rpvlan0 [192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id s2Q9UeKl005708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 26 Mar 2014 09:30:41 GMT Message-ID: <1395826233.24890.81.camel@ted> From: Richard Purdie To: openembedded-core Date: Wed, 26 Mar 2014 09:30:33 +0000 X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Subject: [RFC PATCH 1/3] base.bbclass: Run oe_import before other INHERITs X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 09:30:52 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 --- 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)) }