openmoko2.bbclass, openmoko-base.bbclass: Fix openmoko_two_get_license and openmoko_t...
authorKhem Raj <raj.khem@gmail.com>
Wed, 15 Sep 2010 21:15:39 +0000 (14:15 -0700)
committerKhem Raj <raj.khem@gmail.com>
Thu, 16 Sep 2010 02:16:26 +0000 (19:16 -0700)
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@gmail.com>
classes/openmoko-base.bbclass
classes/openmoko2.bbclass

index f1ca536..b5459d5 100644 (file)
@@ -4,7 +4,10 @@ OPENMOKO_RELEASE ?= "OM-2007.2"
 OPENMOKO_MIRROR ?= "svn://svn.openmoko.org/trunk"
 
 def openmoko_base_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' or section == 'libs': return ""
     elif section in 'apps tools pim'.split(): return "applications"
     elif section == "panel-plugin": return "panel-plugins"
index 1dfef64..25dea82 100644 (file)
@@ -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"