Skip to contentSkip to conversation

openmoko2.bbclass: Fix openmoko_two_get_license and openmoko_two_get_subdir

PATCH New Khem Raj 1 participant 1 message Sep 15, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 openmoko2.bbclass: Fix openmoko_two_get_license and openmoko_two_get_subdir

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 '/'

---
 classes/openmoko2.bbclass |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
classes/openmoko2.bbclass +8 -2
index 1dfef64..25dea82 100644
@@ -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"
Signature · 1 line
1.7.1