Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Christopher Larson <clarson@kergoth.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [wic][PATCH 04/20] wic: Refactor getting bitbake variables
Date: Tue, 30 Jun 2015 11:11:23 +0300	[thread overview]
Message-ID: <20150630081122.GA13937@linux.intel.com> (raw)
In-Reply-To: <CABcZANk_vhTvj+rAyo+T8CbUpPd2SGxGk6m3Mt8WwB-M0LGq0Q@mail.gmail.com>

Hi Cristopher,

On Mon, Jun 29, 2015 at 02:48:30PM -0700, Christopher Larson wrote:
> On Mon, Jun 29, 2015 at 12:10 PM, Ed Bartosh <ed.bartosh@linux.intel.com>
> wrote:
> 
> > +    global _BITBAKE_VARS
> > +
> > +    if image not in _BITBAKE_VARS:
> >
> 
> In general, I’d suggest using a cache class/object rather than globals,
> similar to how it’s handled in bb.checksum, or a transparent LRU. Whenever
> a cache is involved, it’s best to consider what its lifetime is.
> Admittedly, wic isn’t long-running, but best not to get into bad habits.

Thank you for your comment.

I thought about using a cache class and decided not to do it to keep the
code consistent with the rest of the module. As it was global variable
in the old code my implementation doesn't make the code worse I hope.

As far as I'm happy with test coverage I'll do more serious refactoring
and hopefully implement something better than that.

--
Regards,
Ed


  reply	other threads:[~2015-06-30  8:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29 19:10 [wic][PATCH 00/20] miscellaneous fixes. poky-conrib:ed/wic/misc Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 01/20] wic: Fix misleading message Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 02/20] wic: Test rootfs plugin using image recipes Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 03/20] wic: Test rootfs plugin using rootfs paths Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 04/20] wic: Refactor getting bitbake variables Ed Bartosh
2015-06-29 21:48   ` Christopher Larson
2015-06-30  8:11     ` Ed Bartosh [this message]
2015-06-29 19:10 ` [wic][PATCH 05/20] wic: Include mount point into image report Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 06/20] wic: Remove annoing debug message Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 07/20] wic: Turn off debug output for 'bitbake -e' Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 08/20] wic: Refactor prepare_rootfs API Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 09/20] wic: Rename partition images Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 10/20] wic: Get rid of useless variable 'image_rootfs' Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 11/20] wic: Call methods better way Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 12/20] wic: Refactor prepare_empty_partition API Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 13/20] wic: Remove duplicated code Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 14/20] wic: Fix naming conflict Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 15/20] wic: Add --uuid partition option Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 16/20] wic: Refactor fstab update code Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 17/20] wic: Remove __write_partition method Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 18/20] wic: Fix confusing error message Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 19/20] wic: Code cleanup: long lines, identation and whitespaces Ed Bartosh
2015-06-29 19:10 ` [wic][PATCH 20/20] wic: Code cleanup: unused imports Ed Bartosh

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=20150630081122.GA13937@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=clarson@kergoth.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