Re: [bitbake-devel][RFC][PATCH 1/3] lib/bb/fetch2/git.py: add optional major_version parameter to latest_versionstring
Alexander Kanavin <[email protected]>
| Newsgroups | org.openembedded.lists.bitbake-devel |
|---|---|
| Message-ID | <CANNYZj-anuHaAL6bJbkpO_bUuqQd-ZLmdRAA8bLf3iSnMYRzdQ@mail.gmail.com> |
On Wed, 29 Apr 2026 at 05:24, <[email protected]> wrote: > + def latest_versionstring(self, ud, d, major_version=None): ... > + if major_version: > + if not pver.startswith(major_version+'.'): > + continue This handles one way of versioning bugfix releases (x.y.z -> x.y.z+1), but upstreams might invent all kinds of different ways. E.g. systemd is using x -> x.1 -> x.2 -> ..., or openssh is using x.y->x.yp1. Let's make it more general. I'd suggest passing in an optional filter_regex argument that would be matched with a 'candidate' version. Then the most common use case (point releases) could be supported like this: upstream-stable-releases-point.bbclass: UPSTREAM_MAJMIN_VERSION_REGEX = ... (set from ${PV}, e.g. 3.4.5 becomes 3\.4) UPSTREAM_STABLE_RELEASES_REGEX = "${MAJMIN_VERSION}\.\d+" (this in turn becomes 3\.4\.\d+) systemd and openssh on the other hand could set UPSTREAM_STABLE_RELEASES_REGEX directly according to their custom versioning schemas. Then recipes which are known to do release maintenance (in a way that's compatible with Yocto stable policy) via point releases could inherit that class or set regex directly. And recipeutils in oe-core would pick up the regex from UPSTREAM_STABLE_RELEASES_REGEX and pass it in to the fetcher's latest version function. Alex