[oe] [PATCH] openmoko2.bbclass: Fix openmoko_two_get_license and openmoko_two_get_subdir

Khem Raj raj.khem at gmail.com
Wed Sep 15 21:19:08 UTC 2010


Usually openmoko inheriting recipes have SECTION like openmoko/libs
etc then the code works well but for packages e.g. -dev -dbg same
section is not true and the functions fail

File "openmoko2.bbclass", line 2, in openmoko_two_get_subdir
ValueError: need more than 1 value to unpack

This patch makes sure to split the string only if SECTION contains '/'

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 classes/openmoko2.bbclass |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/classes/openmoko2.bbclass b/classes/openmoko2.bbclass
index 1dfef64..25dea82 100644
--- a/classes/openmoko2.bbclass
+++ b/classes/openmoko2.bbclass
@@ -5,11 +5,17 @@ OPENMOKO_RELEASE ?= "OM-2007.2"
 OPENMOKO_MIRROR ?= "svn://svn.openmoko.org/trunk"
 
 def openmoko_two_get_license(d):
-    openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
+    if bb.data.getVar('SECTION', d, 1).find("/") != -1:
+    	openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
+    else:
+        section = bb.data.getVar('SECTION', d, 1)	
     return "LGPL GPL".split()[section != "libs"]
 
 def openmoko_two_get_subdir(d):
-    openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
+    if bb.data.getVar('SECTION', d, 1).find("/") != -1:
+        openmoko, section = bb.data.getVar('SECTION', d, 1).split("/")
+    else:
+        section = bb.data.getVar('SECTION', d, 1)
     if section == 'base': return ""
     elif section == 'libs': return "libraries"
     elif section in 'apps tools pim'.split(): return "applications"
-- 
1.7.1





More information about the Openembedded-devel mailing list