Patchwork [CONSOLIDATED,PULL,10/36] base.bbclass: use isinstance for base_eventhandler

login
register
mail settings
Submitter Saul Wold
Date May 3, 2012, 1:55 a.m.
Message ID <79954d953dfb176e0bf90dc4b2e65485f87f9061.1336008687.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/26895/
State New
Headers show

Comments

Saul Wold - May 3, 2012, 1:55 a.m.
From: Christopher Larson <kergoth@gmail.com>

Signed-off-by: Christopher Larson <kergoth@gmail.com>
---
 meta/classes/base.bbclass |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 07ef9a2..bb39b7b 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -248,12 +248,13 @@  def buildcfg_neededvars(d):
 
 addhandler base_eventhandler
 python base_eventhandler() {
-	from bb.event import getName
-
-	name = getName(e)
-
-	if name.startswith("BuildStarted"):
+        if isinstance(e, bb.event.ConfigParsed):
 		e.data.setVar('BB_VERSION', bb.__version__)
+                generate_git_config(e)
+                pkgarch_mapping(e.data)
+                preferred_ml_updates(e.data)
+
+	if isinstance(e, bb.event.BuildStarted):
 		statuslines = []
 		for func in oe.data.typed_value('BUILDCFG_FUNCS', e.data):
 			g = globals()
@@ -266,11 +267,6 @@  python base_eventhandler() {
 
 		statusheader = e.data.getVar('BUILDCFG_HEADER', True)
 		bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
-
-        if name == "ConfigParsed":
-                generate_git_config(e)
-                pkgarch_mapping(e.data)
-                preferred_ml_updates(e.data)
 }
 
 addtask configure after do_patch