Skip to contentSkip to conversation

bitbake: fetch2: Safer check for BB_ORIGENV datastore

PATCH New [email protected] 1 participant 1 message May 3, 2016

lore
Share & tools
lore
#0 lore raw

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]

---
 bitbake/lib/bb/fetch2/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/__init__.py +2 -1
index e8fbe89..6ef0c6f 100644
@@ -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