public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Antonin Godard <antonin.godard@bootlin.com>,
	Quentin Schulz <foss@0leil.net>,
	bitbake-devel@lists.openembedded.org
Cc: docs@lists.yoctoproject.org, "Robert P. J. Day" <rpjday@crashcourse.ca>
Subject: Re: [docs] [PATCH v2] doc: bitbake-user-manual-intro: improve bbappend file matching doc
Date: Fri, 30 Jan 2026 15:54:29 +0100	[thread overview]
Message-ID: <6e5ce5e9-d2b3-45df-bc0e-834b4035efac@cherry.de> (raw)
In-Reply-To: <DG1ZCGR9A4OJ.3918WSIWBKUDI@bootlin.com>

Hi Antonin,

On 1/30/26 3:06 PM, Antonin Godard wrote:
> Hi,
> 
> On Thu Jan 29, 2026 at 11:07 AM CET, Quentin Schulz wrote:
>> From: Quentin Schulz <quentin.schulz@cherry.de>
>>
>> The recipe name matching wasn't fully explained and were missing a few
>> important corner cases such as recipes without a version, or using the %
>> character outside of the version part of the filename for example.
>>
>> This adds the last missing bits to cover every append naming scenario
>> that exist today.
> 
> Thanks, this was indeed missing!
> 
>> This was derived from lib/bb/cooker.py:get_file_appends().
>>
>> Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
>> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>> ---
>> Changes in v2:
>> - fixed typo for bbappend named bb,
>> - added "a" before "``mesa.bb`` recipe",
>> - Link to v1: https://patch.msgid.link/20260128-bbappend-matching-v1-1-29fef2d63489@cherry.de
>> ---
>>   .../bitbake-user-manual-intro.rst                  | 51 +++++++++++++++++-----
>>   1 file changed, 40 insertions(+), 11 deletions(-)
>>
>> diff --git a/doc/bitbake-user-manual/bitbake-user-manual-intro.rst b/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
>> index baad71304..69ad6037b 100644
>> --- a/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
>> +++ b/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
>> @@ -271,12 +271,9 @@ same root filename. The filenames can differ only in the file type
>>   suffix used (e.g. ``formfactor_0.0.bb`` and
>>   ``formfactor_0.0.bbappend``).
>>   
>> -Information in append files extends or overrides the information in the
>> -underlying, similarly-named recipe files.
>> -
>>   When you name an append file, you can use the "``%``" wildcard character
>> -to allow for matching recipe names. For example, suppose you have an
>> -append file named as follows::
>> +to allow for a less strict recipe name matching. For example, suppose you have
>> +an append file named as follows::
>>   
>>     busybox_1.21.%.bbappend
>>   
>> @@ -290,12 +287,6 @@ the append file would match the following recipe names::
>>     busybox_1.21.10.bb
>>     busybox_1.21.11.bb
>>   
>> -.. note::
>> -
>> -   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.
>> -
>>   If the ``busybox`` recipe was updated to ``busybox_1.3.0.bb``, the
>>   append name would not match. However, if you named the append file
>>   ``busybox_1.%.bbappend``, then you would have a match.
>> @@ -303,6 +294,44 @@ append name would not match. However, if you named the append file
>>   In the most general case, you could name the append file something as
>>   simple as ``busybox_%.bbappend`` to be entirely version independent.
>>   
> 
> I would wrap from here...
> 
>> +The "``%``" character is a marker for BitBake, and everything after that marker
>> +will not be used for matching recipe names. That is, an append file named::
>> +
>> +   busybox_1.%.11.bbappend
>> +
>> +will match recipes named::
>> +
>> +   busybox_1.0.11.bb
>> +   busybox_1.2.bb
>> +   busybox_1.3.48.bb
>> +
>> +Note that the "``%``" character is not specific to the version part of the
>> +recipe name. That is, an append file named::
>> +
>> +   linux-yocto%.bbappend
>> +
>> +will match recipes named::
>> +
>> +   linux-yocto.bb
>> +   linux-yocto_6.18.bb
>> +   linux-yocto-tiny_6.12.bb
>> +   linux-yocto-rt_6.16.bb
>> +
>> +While it can be useful to append to similar recipes with slightly different
>> +names, it is highly discouraged to do so as recipes from other layers may be
>> +named similarly enough that the append file would unwittingly match them.
> 
> ...to there under a .. note:: block. First because it will make it separate from
> the first part of this section, and second because it will highlight that this
> is an in-depth explanation of this percent sign, not really a standard use.
> 

Do you want two separate notes for busybox_1.%.11 and linux-yocto% 
examples? They both are related to % being a marker so I guess they can 
be added in the same note, but while the former example is definitely 
wrong, the latter may sometimes be found (but is mostly wrong as well, 
but in more insidious ways).

Cheers,
Quentin


  reply	other threads:[~2026-01-30 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 10:07 [PATCH v2] doc: bitbake-user-manual-intro: improve bbappend file matching doc Quentin Schulz
2026-01-30 14:06 ` [docs] " Antonin Godard
2026-01-30 14:54   ` Quentin Schulz [this message]
2026-01-30 16:18     ` Antonin Godard

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=6e5ce5e9-d2b3-45df-bc0e-834b4035efac@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=antonin.godard@bootlin.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=foss@0leil.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox