1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

bitbake: 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)

(Bitbake rev: 25859009b710cb35ac8f9ee9eb3a7305f9e13402)

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>
This commit is contained in:
Leonardo Sandoval
2016-05-03 14:55:48 -05:00
committed by Richard Purdie
parent ba29029581
commit ae832446d9
+2 -1
View File
@@ -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)