From d40779a7d3ce4f326c29ec7971731cab1f505a37 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Thu, 19 Nov 2015 11:21:16 +0000 Subject: 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 Signed-off-by: Ross Burton --- meta/lib/oe/image.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'meta/lib') 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//imgdata/.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())) -- cgit 1.2.3-korg