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:12:17 +0100 |
commit | 4f4f1c1fdbae84c6df0b5748258117c7a3438160 (patch) | |
tree | d3032ec8f262b8efbf4053021be627258106c991 /bitbake | |
parent | f00b4e4c3d1d4b7e5f1ba99b099802e3495deba1 (diff) | |
download | poky-4f4f1c1fdbae84c6df0b5748258117c7a3438160.tar.gz |
bitbake: 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)
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index e8fbe89a3a..6ef0c6fe7a 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -813,8 +813,9 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None): | |||
813 | if not cleanup: | 813 | if not cleanup: |
814 | cleanup = [] | 814 | cleanup = [] |
815 | 815 | ||
816 | origenv = d.getVar("BB_ORIGENV", False) | ||
816 | for var in exportvars: | 817 | for var in exportvars: |
817 | val = d.getVar(var, True) or d.getVar("BB_ORIGENV", False).getVar(var, True) | 818 | val = d.getVar(var, True) or (origenv and origenv.getVar(var, True)) |
818 | if val: | 819 | if val: |
819 | cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) | 820 | cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) |
820 | 821 | ||