Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme
@ 2026-05-13 23:17 Viktor Jägersküpper
  2026-05-14 11:31 ` Thomas Weißschuh
  2026-05-14 13:19 ` Nathan Chancellor
  0 siblings, 2 replies; 4+ messages in thread
From: Viktor Jägersküpper @ 2026-05-13 23:17 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Viktor Jägersküpper, Christian Heusel,
	Nathan Chancellor, Nicolas Schier, linux-kbuild, linux-kernel

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 "-rc".

Signed-off-by: Viktor Jägersküpper <viktor_jaegerskuepper@freenet.de>
---
 scripts/package/PKGBUILD | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 452374d63c24..fe629074b4e8 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/rc/;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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme
  2026-05-13 23:17 [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme Viktor Jägersküpper
@ 2026-05-14 11:31 ` Thomas Weißschuh
  2026-05-14 13:19 ` Nathan Chancellor
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-05-14 11:31 UTC (permalink / raw)
  To: Viktor Jägersküpper
  Cc: Christian Heusel, Nathan Chancellor, Nicolas Schier, linux-kbuild,
	linux-kernel

On 2026-05-14 01:17:29+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 "-rc".
> 
> Signed-off-by: Viktor Jägersküpper <viktor_jaegerskuepper@freenet.de>

Acked-by: Thomas Weißschuh <linux@weissschuh.net>

Thanks!

> ---
>  scripts/package/PKGBUILD | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

(...)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme
  2026-05-13 23:17 [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme Viktor Jägersküpper
  2026-05-14 11:31 ` Thomas Weißschuh
@ 2026-05-14 13:19 ` Nathan Chancellor
  2026-05-14 21:46   ` Viktor Jägersküpper
  1 sibling, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2026-05-14 13:19 UTC (permalink / raw)
  To: Viktor Jägersküpper
  Cc: Thomas Weißschuh, Christian Heusel, Nathan Chancellor,
	Nicolas Schier, linux-kbuild, linux-kernel

On Thu, 14 May 2026 01:17:29 +0200, Viktor Jägersküpper <viktor_jaegerskuepper@freenet.de> wrote:
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index 452374d63c24..fe629074b4e8 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/rc/;s/-/_/g')"

Sashiko notes [1] (with a contrived example) that this could result in
custom localversions being matched and adjusted. While I don't think it
is that big of a deal given how specific the example is, it takes little
effort to make the match more restrictive to make such a situation less
likely:

  pkgver="$(echo "${KERNELRELEASE}" | sed 's/-\(rc[0-9]\+\)/\1/;s/-/_/g')"

[1]: https://sashiko.dev/#/patchset/20030

-- 
Cheers,
Nathan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme
  2026-05-14 13:19 ` Nathan Chancellor
@ 2026-05-14 21:46   ` Viktor Jägersküpper
  0 siblings, 0 replies; 4+ messages in thread
From: Viktor Jägersküpper @ 2026-05-14 21:46 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Thomas Weißschuh, Christian Heusel, Nicolas Schier,
	linux-kbuild, linux-kernel

On 5/14/26 15:19, Nathan Chancellor wrote:
> On Thu, 14 May 2026 01:17:29 +0200, Viktor Jägersküpper <viktor_jaegerskuepper@freenet.de> wrote:
>> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
>> index 452374d63c24..fe629074b4e8 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/rc/;s/-/_/g')"
> 
> Sashiko notes [1] (with a contrived example) that this could result in
> custom localversions being matched and adjusted. While I don't think it
> is that big of a deal given how specific the example is, it takes little
> effort to make the match more restrictive to make such a situation less
> likely:
> 
>   pkgver="$(echo "${KERNELRELEASE}" | sed 's/-\(rc[0-9]\+\)/\1/;s/-/_/g')"
> 
> [1]: https://sashiko.dev/#/patchset/20030

I agree this is much better. Actually I should have looked at the
script "mkdebian" for Debian packages which has this line:

upstream_version=$("${srctree}/scripts/setlocalversion" --no-local "${srctree}" | sed 's/-\(rc[1-9]\)/~\1/')

This is incorrect for the (hopefully rare) case that we have 10 or more
"rc" releases, but that can be fixed in another patch.

Best regards,
Viktor

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-14 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 23:17 [PATCH] kbuild: pacman-pkg: make "rc" releases adhere to pacman versioning scheme Viktor Jägersküpper
2026-05-14 11:31 ` Thomas Weißschuh
2026-05-14 13:19 ` Nathan Chancellor
2026-05-14 21:46   ` Viktor Jägersküpper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox