Patchwork [6/6] base.bbclass: use isinstance for base_eventhandler

login
register
mail settings
Submitter Christopher Larson
Date May 1, 2012, 4:02 p.m.
Message ID <8409784e486b7f181231fd46bee5fcdc384de7d3.1335888041.git.kergoth@gmail.com>
Download mbox | patch
Permalink /patch/26763/
State Accepted
Commit 86556a2bfa23ba69fea2ade14599054b186150cd
Headers show

Comments

Christopher Larson - May 1, 2012, 4:02 p.m.
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