Unverified Commit 20255071 authored by Viktor Jägersküpper's avatar Viktor Jägersküpper Committed by Nicolas Schier
Browse files

kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme



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: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarViktor Jägersküpper <viktor_jaegerskuepper@freenet.de>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260515215913.92481-1-viktor_jaegerskuepper@freenet.de


Fixes: c8578539 ("kbuild: add script and target to generate pacman package")
Signed-off-by: default avatarNicolas Schier <nsc@kernel.org>
parent 49f8fcde
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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}"