diff options
author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2016-05-03 14:55:48 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-06 10:11:58 +0100 |
commit | f368f5ae64a1681873f3d81f3cb8fb38650367b0 (patch) | |
tree | 5b31db1175cc46414592799e052b6d842290335e | |
parent | f62d9a3e86e384f928fc8ad077d7cf3a75d1591e (diff) | |
download | openembedded-core-contrib-f368f5ae64a1681873f3d81f3cb8fb38650367b0.tar.gz |
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]
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index e8fbe89a3a..6ef0c6fe7a 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) |