Patchwork [v2,1/3] uboot-config.bbclass: Use an annonymous python function

login
register
mail settings
Submitter Otavio Salvador
Date Sept. 19, 2013, 8:48 p.m.
Message ID <1379623718-29690-2-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/58393/
State New
Headers show

Comments

Otavio Salvador - Sept. 19, 2013, 8:48 p.m.
The processing needs to happen per recipe and thus it ought to use
annonymous python function instead to be triggered at event.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v2: None

 meta/classes/uboot-config.bbclass | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index fc37620..44b46ff 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -7,14 +7,12 @@ 
 #
 # Copyright 2013 (C) O.S. Systems Software LTDA.
 
-addhandler uboot_config_eventhandler
-uboot_config_eventhandler[eventmask] = "bb.event.ConfigParsed"
-python uboot_config_eventhandler() {
-    ubootconfigflags = e.data.getVarFlags('UBOOT_CONFIG')
+python () {
+    ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
     if not ubootconfigflags:
         return
 
-    ubootconfig = (e.data.getVar('UBOOT_CONFIG', True) or "").split()
+    ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
     if len(ubootconfig) > 1:
         raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
     elif len(ubootconfig) == 0:
@@ -31,9 +29,9 @@  python uboot_config_eventhandler() {
 
         if ubootconfig == f:
             bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
-            e.data.setVar('UBOOT_MACHINE', items[0])
+            d.setVar('UBOOT_MACHINE', items[0])
 
             if items[1]:
                 bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
-                e.data.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+                d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
 }