From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ben Hutchings <ben@decadent.org.uk>,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>
Subject: [PATCH] kbuild: deb-pkg: fix versioning for -rc releases
Date: Wed, 12 Mar 2025 04:01:33 +0900 [thread overview]
Message-ID: <20250311190212.634123-1-masahiroy@kernel.org> (raw)
The version number with -rc should be considered older than the final
release.
For example, 6.14-rc1 should be older than 6.14, but to handle this
correctly (just like Debian kernel), "-rc" must be replace with "~rc".
$ dpkg --compare-versions 6.14-rc1 lt 6.14
$ echo $?
1
$ dpkg --compare-versions 6.14~rc1 lt 6.14
$ echo $?
0
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/package/mkdebian | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 193e33bcb989..80ed96561993 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -167,7 +167,9 @@ version=$KERNELRELEASE
if [ "${KDEB_PKGVERSION:+set}" ]; then
packageversion=$KDEB_PKGVERSION
else
- packageversion=$(${srctree}/scripts/setlocalversion --no-local ${srctree})-$($srctree/scripts/build-version)
+ upstream_version=$("${srctree}/scripts/setlocalversion" --no-local "${srctree}" | sed 's/-\(rc[1-9]\)/~\1/')
+ debian_revision=$("${srctree}/scripts/build-version")
+ packageversion=${upstream_version}-${debian_revision}
fi
sourcename=${KDEB_SOURCENAME:-linux-upstream}
--
2.43.0
next reply other threads:[~2025-03-11 19:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 19:01 Masahiro Yamada [this message]
2025-03-11 19:20 ` Nathan Chancellor
2025-03-12 12:25 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250311190212.634123-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=ben@decadent.org.uk \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®