Skip to contentSkip to conversation

classes/native*.bbclass: fix error during parse with bitbake master

PATCH Superseded Paul Eggleton 4 participants 5 messages Jun 22, 2011 – Jun 23, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes/native*.bbclass: fix error during parse with bitbake master

Fixes "AttributeError: 'NoneType' object has no attribute 'split'" during parsing with bitbake master. We should not be calling explode_deps with None as the argument, so check for that before calling it.

---
 classes/native.bbclass    |    5 ++++-
 classes/nativesdk.bbclass |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
classes/native.bbclass +4 -1
index 1e7a6ec..e9d48a3 100644
@@ -116,7 +116,10 @@ python __anonymous () {
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
         pn = bb.data.getVar("PN", d, True)
         depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
-        deps = bb.utils.explode_deps(depends)
+        if depends:
+            deps = bb.utils.explode_deps(depends)
+        else:
+            deps = []
         newdeps = []
         for dep in deps:
             if dep.endswith("-cross"):
classes/nativesdk.bbclass +4 -1
index 6689399..7a8f385 100644
@@ -59,7 +59,10 @@ OVERRIDES =. "virtclass-nativesdk:"
 python __anonymous () {
     pn = bb.data.getVar("PN", d, True)
     depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True)
-    deps = bb.utils.explode_deps(depends)
+    if depends:
+        deps = bb.utils.explode_deps(depends)
+    else:
+        deps = []
     newdeps = []
     for dep in deps:
         if dep.endswith("-native") or dep.endswith("-cross"):
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Paul Eggleton

Fixes "AttributeError: 'NoneType' object has no attribute 'split'" during parsing with bitbake master. We should not be calling explode_deps with None as the argument, so check for that before calling it.

Looks good to me:

Quoted 27 lines
---
 classes/native.bbclass    |    5 ++++-
 classes/nativesdk.bbclass |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
classes/native.bbclass +4 -1
index 1e7a6ec..e9d48a3 100644
@@ -116,7 +116,10 @@ python __anonymous () {
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
         pn = bb.data.getVar("PN", d, True)
         depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
-        deps = bb.utils.explode_deps(depends)
+        if depends:
+            deps = bb.utils.explode_deps(depends)
+        else:
+            deps = []
         newdeps = []
         for dep in deps:
             if dep.endswith("-cross"):
classes/nativesdk.bbclass +0 -0
index 6689399..7a8f385 100644
@@ -59,7 +59,10 @@ OVERRIDES =. "virtclass-nativesdk:"
 python __anonymous () {

classes/nativesdk.bbclass OVERRIDES =. "virtclass-nativesdk:" · line 68

Quoted 10 lines
classes/nativesdk.bbclass +4 -1
     pn = bb.data.getVar("PN", d, True)
     depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True)
-    deps = bb.utils.explode_deps(depends)
+    if depends:
+        deps = bb.utils.explode_deps(depends)
+    else:
+        deps = []
     newdeps = []
     for dep in deps:
         if dep.endswith("-native") or dep.endswith("-cross"):

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFOAbV/MkyGM64RGpERAmpPAJ9OxqPqnYkcACLshJHBf2B2ta1FQgCfRadV O+QuQwiB6rHxDcDeUkwydew=
=fWJI
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Paul Eggleton

classes/native.bbclass python __anonymous () { · line 122

Quoted 6 lines · Paul Eggleton

depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)

classes/native.bbclass +4 -1
-        deps = bb.utils.explode_deps(depends)
+        if depends:
+            deps = bb.utils.explode_deps(depends)
+        else:
+            deps = []

Can't you just make the first line be something like

depends = bb.data.getVar("DEPENDS_virtclass-native", d, True) or ""

?

p.

#3 lore raw

PATCH v2 1/1 classes/native*.bbclass: fix error during parse with bitbake master

Fixes "AttributeError: 'NoneType' object has no attribute 'split'" during parsing with bitbake master. We should not be calling explode_deps with None as the argument, so ensure the value isn't None.

---
 classes/native.bbclass    |    2 +-
 classes/nativesdk.bbclass |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
classes/native.bbclass +1 -1
index 1e7a6ec..6f30471 100644
@@ -115,7 +115,7 @@ python __anonymous () {
 
     if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
         pn = bb.data.getVar("PN", d, True)
-        depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
+        depends = bb.data.getVar("DEPENDS_virtclass-native", d, True) or ""
         deps = bb.utils.explode_deps(depends)
         newdeps = []
         for dep in deps:
classes/nativesdk.bbclass +1 -1
index 6689399..6607abf 100644
@@ -58,7 +58,7 @@ OVERRIDES =. "virtclass-nativesdk:"
 
 python __anonymous () {
     pn = bb.data.getVar("PN", d, True)
-    depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True)
+    depends = bb.data.getVar("DEPENDS_virtclass-nativesdk", d, True) or ""
     deps = bb.utils.explode_deps(depends)
     newdeps = []
     for dep in deps:
Signature · 1 line
1.7.4.1
Acked-by on v2 1/1
#4 lore raw
Quoted 10 lines · Paul Eggleton

Fixes "AttributeError: 'NoneType' object has no attribute 'split'" during parsing with bitbake master. We should not be calling explode_deps with None as the argument, so ensure the value isn't None.

---
 classes/native.bbclass    |    2 +-
 classes/nativesdk.bbclass |    2 +-

 2 files changed, 2 insertions(+), 2 deletions(-)

<snip>