mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Meng Tang <tangmeng@uniontech.com>
To: masahiroy@kernel.org, linux-kernel@vger.kernel.org
Cc: Meng Tang <tangmeng@uniontech.com>
Subject: [PATCH] kbuild: optimize the increments the version number rules
Date: Thu, 16 Feb 2023 16:42:09 +0800	[thread overview]
Message-ID: <20230216084209.4783-1-tangmeng@uniontech.com> (raw)

Currently, the build version of the kernel can only count integers.
If the user defines that the version in .version is a non-integer
number, the build version will be '1'.

The original intention of the version rule as I understand it is to
initialize the version to '1' when the user does not define a build
version.

In order to allow users to define a non-integer kernel version, and
it will not be automatically changed to '1' after definition, this
modification is submitted

Fixes: 2df8220cc511 ("kbuild: build init/built-in.a just once")

Signed-off-by: Meng Tang <tangmeng@uniontech.com>
---
 init/build-version | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/init/build-version b/init/build-version
index 537d45815083..ca985dc285cc 100755
--- a/init/build-version
+++ b/init/build-version
@@ -3,7 +3,12 @@
 
 prev_ver=$(cat .version 2>/dev/null) &&
 ver=$(expr ${prev_ver} + 1 2>/dev/null) ||
-ver=1
+if [ X$prev_ver = "X" ]
+then
+	ver=1
+else
+	ver=$prev_ver
+fi
 
 echo ${ver} > .version
 
-- 
2.20.1


                 reply	other threads:[~2023-02-16  8:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230216084209.4783-1-tangmeng@uniontech.com \
    --to=tangmeng@uniontech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /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®