Patchwork [RFC,2/3] base.bbclass: Merge two ConfigParsed event handlers

login
register
mail settings
Submitter Richard Purdie
Date March 26, 2014, 9:31 a.m.
Message ID <1395826269.24890.82.camel@ted>
Download mbox | patch
Permalink /patch/69243/
State New
Headers show

Comments

Richard Purdie - March 26, 2014, 9:31 a.m.
There were two ConfigParsed event handlers in base.bbclass, this merges
them together for small efficiency wins.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f085173..360b112 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -38,13 +38,6 @@  def oe_import(d):
 BASEIMPORTS = "${@oe_import(d)}"
 inherit ${BASEIMPORTS}
 
-python oe_import_eh () {
-    e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
-}
-
-addhandler oe_import_eh
-oe_import_eh[eventmask] = "bb.event.ConfigParsed"
-
 def lsb_distro_identifier(d):
     adjust = d.getVar('LSB_DISTRO_ADJUST', True)
     adjust_func = None
@@ -296,6 +289,7 @@  addhandler base_eventhandler
 base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted"
 python base_eventhandler() {
     if isinstance(e, bb.event.ConfigParsed):
+        e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
         e.data.setVar('BB_VERSION', bb.__version__)
         pkgarch_mapping(e.data)
         preferred_ml_updates(e.data)