From 4f4f1c1fdbae84c6df0b5748258117c7a3438160 Mon Sep 17 00:00:00 2001 From: Leonardo Sandoval Date: Tue, 3 May 2016 14:55:48 -0500 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake') 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): 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) -- cgit v1.2.3-54-g00ecf