Re: [PATCH v2] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme

From: Thomas Weißschuh

Date: Sun May 17 2026 - 05:41:24 EST


On 2026-05-17 14:00:56+0900, Nathan Chancellor wrote:
> On Sun, May 17, 2026 at 02:57:07AM +0200, Viktor Jägersküpper wrote:
> > On 5/16/26 17:33, Nathan Chancellor wrote:
> > > On Sat, May 16, 2026 at 04:27:39PM +0200, Viktor Jägersküpper wrote:
> > >> On 5/15/26 23:58, Viktor Jägersküpper wrote:

(...)

> > >>> -pkgver="${KERNELRELEASE//-/_}"
> > >>> +pkgver="$(echo "${KERNELRELEASE}" | sed 's/-\(rc[0-9]\+\)/\1/;s/-/_/g')"
> > >>
> > >> I will send a v3 patch later with the first substitution changed to
> > >> match "-rcN" where N is a strictly positive integer because this is
> > >> what we really had in the kernel so far, at least as far as I can
> > >> remember.
> > >
> > > Do you mean dropping the '\+' portion of the regex? If so, I think I
> > > would rather keep what you have here since while an -rc10 is incredibly
> > > unlikely nowadays (we pretty much never go past -rc8), it has happened
> > > once before in 3.1:
> > >
> > > $ git tag -l | grep -- -rc10
> > > v3.1-rc10
> >
> > I was only concerned about 'rc0', so I came up with this:
> >
> > 's/-\(rc[1-9][0-9]*\)/\1/;s/-/_/g'
> >
> > For 'rc' releases starting from 'rc1' this matches '-rcN' where N is a
> > strictly positive integer. Since 'git tag -l | grep -- rc0' shows
> > nothing, I assume that there is an unwritten rule that counting from 1
> > is the correct choice for kernel 'rc' releases. :-)
> >
> > Compare that to the Debian substitution code: 's/-\(rc[1-9]\)/~\1/'
>
> While you are correct that the kernel does not use -rc0, I don't think
> it is worth preemptively complicating the regex to avoid treating -rc0
> differently from -rc1 and beyond; I find the way it is currently written
> to be more readable but maybe Christian or Thomas feel differently.

I agree with Nathan here, let's keep it simple.


Thomas