From: "Richard Purdie" <richard.purdie@linuxfoundation.org>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>,
Mark Hatle <mark.hatle@kernel.crashing.org>
Cc: BitBake developer list <bitbake-devel@lists.openembedded.org>
Subject: Re: [bitbake-devel] still confused about valid wildcarding for bbappend files
Date: Tue, 06 Apr 2021 22:19:43 +0100 [thread overview]
Message-ID: <3984862b382b08d5da05f740d86075d8f2acd322.camel@linuxfoundation.org> (raw)
In-Reply-To: <5166362-3350-5421-72c5-3eea3ca947fe@crashcourse.ca>
On Tue, 2021-04-06 at 12:34 -0400, Robert P. J. Day wrote:
> On Tue, 6 Apr 2021, Mark Hatle wrote:
>
> > On 4/4/21 2:51 PM, Robert P. J. Day wrote:
> > >
> > > from current bitbake manual:
> > >
> > > https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-intro.html?highlight=wildcard#append-files
> > >
> > > "The use of the ” % ” character is limited in that it only works
> > > directly in front of the .bbappend portion of the append file’s name.
> > > You cannot use the wildcard character in any other location of the
> > > name."
> >
> > The filename is broken up into: name_version.bbappend I believe the
> > intention is that only "version" can contain wild cards.
>
> that was my understanding all this time.
>
> > > that *appears* to suggest that you can have one (and exactly
> > > one) "%" before the ".bbappend" suffix. so how does that
> > > explanation cover examples in some of the OE layers like:
> > >
> > > meta-security/recipes-kernel/linux/linux-%_5.%.bbappend
> > > meta-anaconda/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend
> >
> > "%" is a wildcard for the _version_ only.
> >
> > It is my understanding it can be used in any part of the version
> > string, but can NOT be used in the name. The above example shows it
> > being used in the linux- recipe name. So perhaps that has changed.
>
> agreed, that example is a bit of a surprise.
>
> > The later example (gtk+3) it's being used in the versioning, but looks
> > unnecessary as it's just patching all of the version elements anyway.
>
> perhaps, unless by adding the periods, it's saying that the version
> number must contain *at least* three components (since the final "%"
> will always suck up whatever remains). but that's just a guess, and
> probably wildly wrong.
>
> > The general case is:
> >
> > recipe_1.0.3.bb
> >
> > recipe_%.bbappend - match all versions
> >
> > recipe_1.%.bbappend - match all 1.x versions
> >
> > recipe_1.0.%.bbappend - match all 1.0.x versions
> >
> > Any other usage might work, but I doubt has been seriously tested.
> > (And the key isn't that the '%' be right before the bbappend! It
> > just happens to be there.)
>
> that's pretty much the way i'd always thought of it, but perhaps
> we've been mistaken all this time. :-)
As Mark says, the above is what is documented and meant to work.
Easiest way to figure this out is to check what the code actually
implements to handle it. The code (from cooker.py) says:
def get_file_appends(self, fn):
"""
Returns a list of .bbappend files to apply to fn
"""
filelist = []
f = os.path.basename(fn)
for b in self.bbappends:
(bbappend, filename) = b
if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])):
filelist.append(filename)
return tuple(filelist)
so it actually truncates the expression at the first % and ignores
anything after the first one. That is there to chop the bbappend off
but can obviously chop off more.
meta-security/recipes-kernel/linux/linux-%_5.%.bbappend
may as well be:
meta-security/recipes-kernel/linux/linux-%.bbappend
so matches a bit more than expected and
meta-anaconda/recipes-gnome/gtk+/gtk+3_%.%.%.bbappend
is effectively
meta-anaconda/recipes-gnome/gtk+/gtk+3_%.bbappend
Cheers,
Richard
next prev parent reply other threads:[~2021-04-06 21:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-04 19:51 still confused about valid wildcarding for bbappend files Robert P. J. Day
2021-04-06 15:56 ` [bitbake-devel] " Mark Hatle
2021-04-06 16:34 ` Robert P. J. Day
2021-04-06 21:19 ` Richard Purdie [this message]
2021-04-07 9:02 ` Robert P. J. Day
2021-04-07 16:05 ` Richard Purdie
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=3984862b382b08d5da05f740d86075d8f2acd322.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=mark.hatle@kernel.crashing.org \
--cc=rpjday@crashcourse.ca \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.