From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: "Patches and discussions about the oe-core layer"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] utils.bbclass: skip empty paths when handling FILESEXTRAPATHS
Date: Mon, 22 Aug 2011 14:01:15 +0100 [thread overview]
Message-ID: <201108221401.15860.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <20110819221653.GE22251@jama.jama.net>
On Friday 19 August 2011 23:16:53 Martin Jansa wrote:
> On Fri, Aug 19, 2011 at 03:11:08PM -0700, Chris Larson wrote:
> > On Fri, Aug 19, 2011 at 5:16 AM, <martin.jansa@gmail.com> wrote:
> > > From: Martin Jansa <Martin.Jansa@gmail.com>
> > >
> > > * if there is multiple .bbappend files with FILESEXTRAPATHS_prepend :=
> > > "/:" then the one parsed last is causing trailing ':' and that's
> > > causing empty element in path = extrapaths.split(:) + path
> > > * it's hard to keep all .bbappends from foreign layers to follow this
> > > rule, so it's better to be able to handle trailing ':'
> > >
> > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > > ---
> > > meta/classes/utils.bbclass | 5 +++--
> > > 1 files changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
> > > index 56abdd8..3c2e342 100644
> > > --- a/meta/classes/utils.bbclass
> > > +++ b/meta/classes/utils.bbclass
> > > @@ -338,8 +338,9 @@ def base_set_filespath(path, d):
> > > # The ":" ensures we have an 'empty' override
> > > overrides = (bb.data.getVar("OVERRIDES", d, 1) or "") + ":"
> > > for p in path:
> > > - for o in overrides.split(":"):
> > > - filespath.append(os.path.join(p, o))
> > > + if p != "":
> > > + for o in overrides.split(":"):
> > > + filespath.append(os.path.join(p, o))
> >
> > You shouldn't use 'p != "":'. Instead, use the fact that the empty
> > string is false in boolean context. 'if p:'.
> >
> > Of course, you could also use filter. path = filter(None, path) --
> > filtering an iterable with a function of None results in it dropping
> > all false values. But then, there's a tendency nowadays to avoid
> > map/filter/etc, so that's probably not best :)
>
> does it apply to all != "" in utils.bbclass? because I've used it just
> because it's at least 3 times in this file already.. so to be consistent
> with the rest..
FWIW I agree with Martin; I wouldn't hold back the patch just for this reason
- it's not incorrect code, it's consistent with the rest of the file, and we
can easily clean these up later.
Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>
- Paul
--
Paul Eggleton
Intel Open Source Technology Centre
next prev parent reply other threads:[~2011-08-22 13:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 12:16 [PATCH] utils.bbclass: skip empty paths when handling FILESEXTRAPATHS martin.jansa
2011-08-19 22:11 ` Chris Larson
2011-08-19 22:16 ` Martin Jansa
2011-08-22 13:01 ` Paul Eggleton [this message]
2011-08-24 23:16 ` Chris Larson
2011-08-25 0:16 ` Paul Eggleton
2011-08-25 0:20 ` Chris Larson
2011-08-25 1:24 ` Richard Purdie
2011-08-25 1:29 ` Chris Larson
2011-08-25 9:18 ` Phil Blundell
2011-08-25 13:49 ` Chris Larson
2011-08-24 3:41 ` Saul Wold
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=201108221401.15860.paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.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