classes/native*.bbclass: fix error during parse with bitbake master
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
@@ -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
@@ -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
-----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_depswith None as the argument, so check for that before calling it.Signed-off-by Paul Eggleton <[email protected]>
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@@ -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@@ -59,7 +59,10 @@ OVERRIDES =. "virtclass-nativesdk:" python __anonymous () {
classes/nativesdk.bbclass OVERRIDES =. "virtclass-nativesdk:" · line 68
Quoted 10 lines
classes/nativesdk.bbclass +4
-1pn = 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-----
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.
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
@@ -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
@@ -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
Quoted 10 lines · Paul Eggleton
Fixes "AttributeError: 'NoneType' object has no attribute 'split'" during parsing with bitbake master. We should not be calling
explode_depswith None as the argument, so ensure the value isn't None.Signed-off-by Paul Eggleton <[email protected]>---
classes/native.bbclass | 2 +-
classes/nativesdk.bbclass | 2 +-2 files changed, 2 insertions(+), 2 deletions(-)
<snip>