public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>,
	Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Subject: Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
Date: Wed, 30 Mar 2022 13:42:51 +0200	[thread overview]
Message-ID: <192b477d-bac4-0c02-2345-74d2c3dbde28@weidmueller.com> (raw)
In-Reply-To: <CANNYZj_AH8pTcynXzUurmoY15y4yLo8o1V2GjAQEAHkwV-7L9w@mail.gmail.com>

Hi Alex,

Am 30.03.2022 um 10:41 schrieb Alexander Kanavin:
> Mangling PV is more flexibly done with a lambda function in the
> recipe, where you can trim and tweak PV to your heart's desire, e.g.
> gnomebase.bbclass:
> 
> def gnome_verdir(v):
>      return ".".join(v.split(".")[:-1])
> 
> SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"

What is the intention of your comment? Do you recommend a function per 
recipe and thereby code duplication?

Or is your objection that the base package version isn't always the file 
name version and the variable name is wrong?

The advantage of the BPV is that you can change the PV outside of the 
recipe file:

PV:pn-<package_name> = "${BPV}+git${SRCPV}"

The `PV .= "+git${SRCPV}"` assume that the PV is the base package 
version but couldn't ensure it.

Regards
   Stefan

> On Wed, 30 Mar 2022 at 10:16, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a base package version (BPV) variable and use it as default for the
>> package version (PV) variable. The BPV variable contains the base
>> package version of the recipe read from the recipe filename.
>>
>> The base package version variable supports an expansion of the version
>> from the recipe filename without the need of an immediate variable
>> expansion:
>>      PV = "${BPV}+git${SRCPV}"
>>
>> It allows the inclusion of include files inside a recipe file with the
>> same version in the recipe and include filename even if the package
>> version is different to the base package version in the filename:
>>      require linux-yocto-${BPV}.inc
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> ---
>>
>>   meta/conf/bitbake.conf | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 7705415a4f..d56cf811ba 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
>>   ##################################################################
>>
>>   PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
>> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +PV = "${BPV}"
>>   PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>>   PE = ""
>>   PF = "${PN}-${EXTENDPE}${PV}-${PR}"
>> --
>> 2.30.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
>> Mute This Topic: https://lists.openembedded.org/mt/90127138/1686489
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>


  parent reply	other threads:[~2022-03-30 11:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30  8:16 [RFC PATCH] bitbake.conf: Add base package version (BPV) variable Stefan Herbrechtsmeier
2022-03-30  8:41 ` [OE-core] " Alexander Kanavin
2022-03-30  8:41   ` Alexander Kanavin
2022-03-30 11:42   ` Stefan Herbrechtsmeier [this message]
2022-03-30 11:46     ` Alexander Kanavin
2022-03-30 11:51 ` Richard Purdie
2022-03-30 16:23   ` Stefan Herbrechtsmeier
2022-03-30 17:32 ` Khem Raj
2022-03-31  7:15   ` Stefan Herbrechtsmeier

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=192b477d-bac4-0c02-2345-74d2c3dbde28@weidmueller.com \
    --to=stefan.herbrechtsmeier-oss@weidmueller.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefan.herbrechtsmeier@weidmueller.com \
    /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