From: Martin Jansa <martin.jansa@gmail.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: Sat, 20 Aug 2011 00:16:53 +0200 [thread overview]
Message-ID: <20110819221653.GE22251@jama.jama.net> (raw)
In-Reply-To: <CABcZAN=mt6HCmtMnX+P4-BAOkQwZZ3uCS_sT+uutziBu0VYv9w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]
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..
Regards,
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
next prev parent reply other threads:[~2011-08-19 22:21 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 [this message]
2011-08-22 13:01 ` Paul Eggleton
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=20110819221653.GE22251@jama.jama.net \
--to=martin.jansa@gmail.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