summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2016-05-03 14:55:48 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-29 19:35:39 +0100
commit25859009b710cb35ac8f9ee9eb3a7305f9e13402 (patch)
tree3b172d9648dde387ffd31e7d9ae0032c4ace1d54
parent26379ff2b686313c82af87a3a35b47adbc0183be (diff)
downloadbitbake-25859009b710cb35ac8f9ee9eb3a7305f9e13402.tar.gz
fetch2: Safer check for BB_ORIGENV datastore
BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError exception when calling the getVar method. To avoid this, a check is done before accesing it. [YOCTO #9567] (Bitbake rev: f368f5ae64a1681873f3d81f3cb8fb38650367b0) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index e8fbe89a3..6ef0c6fe7 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -813,8 +813,9 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None):
if not cleanup:
cleanup = []
+ origenv = d.getVar("BB_ORIGENV", False)
for var in exportvars:
- val = d.getVar(var, True) or d.getVar("BB_ORIGENV", False).getVar(var, True)
+ val = d.getVar(var, True) or (origenv and origenv.getVar(var, True))
if val:
cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)