On Mon, 11 May 2026 at 12:06, ChenQi <[email protected]> wrote:
> Introduce one configurable variable for this bbclass:
> MAJMIN_VERSION_PARTS ?= ""
>
> By default, it's not set and the majmin version should be the [:-1] part
> (I mean for 1.2.3, majmin is 1.2). And for recipes like systemd/kmod,
> when inheriting this bbclass, they should also set MAJMIN_VERSION_PARTS
> = "1", so the majmin version is [:1]. Recipes who want to do x.y ->
> x.y.1 or x.y -> x.y.1.1 can set MAJMIN_VERSION_PARTS = "2", so that the
> majmin version is [:2] which is x.y in this case.
>
> The number of recipes setting this var should be few.
>
> What do you think about the above solution?
I agree with introducing the variable for configuration, but the
problem with using the [:-1] default is that it sets up an upgrade
'trap' where this sequence in stable x.y releases:
x.y.z -> x.y.z.zz
x.y.z.zz -> x.y.z+1
will cause recipes to get stuck at x.y.z.zz.
My proposal is:
- let's drop the majmin naming, it's only suitable for major.minor
schemes. I'd suggest naming it STABLE_VERSION_PARTS.
- then the class would slice that many parts from the front, and then
add a regex that says 'anything after this is a maintenance release'.
STABLE_VERSION_PARTS ?= "2"
def get_stable_version_regex(d):
pv = d.getVar('PV')
stable_parts = pv.split('.')[:int(d.getVar('STABLE_VERSION_PARTS'))]
return '\.'.join(stable_parts)
STABLE_VERSION_REGEX = "${@get_stable_version_regex(d)}"
UPSTREAM_STABLE_RELEASE_REGEX = "${STABLE_VERSION_REGEX}.+"
I think this should cover everything common?
Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236807):
https://lists.openembedded.org/g/openembedded-core/message/236807
Mute This Topic: https://lists.openembedded.org/mt/119226368/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-