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

From: Nathan Chancellor

Date: Sun May 17 2026 - 06:24:27 EST


On Fri, May 15, 2026 at 11:58:45PM +0200, Viktor Jägersküpper wrote:
> The package versioning scheme does not enable smooth upgrades from "rc"
> releases to the corresponding stable releases (e.g. 7.0.0-rc7 -> 7.0.0)
> because pacman considers that a downgrade due to the underscore in
> pkgver (e.g. 7.0.0_rc7), see e.g. vercmp(8) for an explanation of the
> package version comparison used by pacman. Package versions which are
> derived from said releases (e.g. built from git revisions) are
> similarly affected. Fix this by modifying pkgver in order to remove the
> hyphen from kernel versions containing "-rcN", where N is a
> non-negative integer.
>
> Acked-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
> Signed-off-by: Viktor Jägersküpper <viktor_jaegerskuepper@xxxxxxxxxx>

Nicolas, do you want to take this as a fix for 7.1 (since it seems
reasonable to correct this for folks building from upstreaam sooner
rather than later)? If so:

Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx>

Otherwise, I can pick it up for 7.2 when I am fully back online in a
couple of days.

> ---
> v1 -> v2:
> - make the substitution more restrictive
> - enhance commit message accordingly
> - add Acked-by tag
>
> v1: https://lore.kernel.org/linux-kbuild/20260513231745.51780-1-viktor_jaegerskuepper@xxxxxxxxxx/
>
> BTW this also works for something like "5.10.248-rt143-rc1" which is a
> recent example of an "rc" release of a realtime kernel.
>
> scripts/package/PKGBUILD | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index 452374d63c24..1213c8e04671 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -10,7 +10,7 @@ for pkg in $_extrapackages; do
> pkgname+=("${pkgbase}-${pkg}")
> done
>
> -pkgver="${KERNELRELEASE//-/_}"
> +pkgver="$(echo "${KERNELRELEASE}" | sed 's/-\(rc[0-9]\+\)/\1/;s/-/_/g')"
> # The PKGBUILD is evaluated multiple times.
> # Running scripts/build-version from here would introduce inconsistencies.
> pkgrel="${KBUILD_REVISION}"
>
> ---
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
>
> Best regards,
> Viktor
> --
> 2.54.0

--
Cheers,
Nathan