bitbake: fetch2: Safer check for BB_ORIGENV datastore
PATCH 1/1 bitbake: fetch2: Safer check for BB_ORIGENV datastore
From: Leonardo Sandoval <[email protected]>
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]
Signed-off-by Leonardo Sandoval <[email protected]>
--- bitbake/lib/bb/fetch2/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/__init__.py +2 -1
@@ -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)
Signature · 1 line
2.6.6