From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Mike Crowe <mac@mcrowe.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/2] image.py: Avoid creating empty .env file in _write_wic_env
Date: Mon, 23 Nov 2015 19:28:54 +0200 [thread overview]
Message-ID: <20151123172854.GA17558@linux.intel.com> (raw)
In-Reply-To: <1447932076-29848-1-git-send-email-mac@mcrowe.com>
Looks good to me.
Acked-by: Ed Bartosh <ed.bartosh@linux.intel.com>
On Thu, Nov 19, 2015 at 11:21:16AM +0000, Mike Crowe wrote:
> 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>
> ---
> meta/lib/oe/image.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
> index 8c797ec..ceaade7 100644
> --- a/meta/lib/oe/image.py
> +++ b/meta/lib/oe/image.py
> @@ -336,6 +336,10 @@ 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')
> try:
> @@ -350,7 +354,7 @@ class Image(ImageDepGraph):
> raise
> 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()))
> --
> 2.1.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
--
Regards,
Ed
prev parent reply other threads:[~2015-11-23 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 11:21 [PATCH 2/2] image.py: Avoid creating empty .env file in _write_wic_env Mike Crowe
2015-11-23 17:28 ` Ed Bartosh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151123172854.GA17558@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=mac@mcrowe.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox