diff options
author | Mike Crowe <mac@mcrowe.com> | 2015-11-19 11:21:16 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:30:53 +0000 |
commit | d40779a7d3ce4f326c29ec7971731cab1f505a37 (patch) | |
tree | 8ecd155604f1c08017c3d7ca33e297a3b83f1fb8 | |
parent | 5e5bf4f7e242494ed9c2cbc13bec7f21494db17c (diff) | |
download | openembedded-core-d40779a7d3ce4f326c29ec7971731cab1f505a37.tar.gz openembedded-core-d40779a7d3ce4f326c29ec7971731cab1f505a37.tar.bz2 openembedded-core-d40779a7d3ce4f326c29ec7971731cab1f505a37.zip |
image.py: Avoid creating empty .env file in _write_wic_env
Creating a file for every image containing a few variables isn't
necessary if wic is not being used, so don't write the file if WICVARS
is empty.
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/lib/oe/image.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py index 9580562580..f0843de928 100644 --- a/meta/lib/oe/image.py +++ b/meta/lib/oe/image.py @@ -335,13 +335,17 @@ class Image(ImageDepGraph): Write environment variables used by wic to tmp/sysroots/<machine>/imgdata/<image>.env """ + wicvars = self.d.getVar('WICVARS', True) + if not wicvars: + return + stdir = self.d.getVar('STAGING_DIR_TARGET', True) outdir = os.path.join(stdir, 'imgdata') if not os.path.exists(outdir): os.makedirs(outdir) basename = self.d.getVar('IMAGE_BASENAME', True) with open(os.path.join(outdir, basename) + '.env', 'w') as envf: - for var in self.d.getVar('WICVARS', True).split(): + for var in wicvars.split(): value = self.d.getVar(var, True) if value: envf.write('%s="%s"\n' % (var, value.strip())) |