diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-20 11:14:37 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-20 11:14:37 +0300 |
| commit | f16a70c0472ea4cda3ab53fd3b5d2fa5628fb2c7 (patch) | |
| tree | d4cc4eacbe86b093d0425236afb7118b3f104345 /scripts/setlocalversion | |
| parent | 15ac1122fd6d4bf408a03e6f23c7ad4f60b22f9e (diff) | |
| parent | e8d018dd0257f744ca50a729e3d042cf2ec9da65 (diff) | |
| download | linux-f16a70c0472ea4cda3ab53fd3b5d2fa5628fb2c7.tar.xz | |
Merge 6.3-rc3 into tty-next
We need the tty/serial fixes in here and it resolves a merge conflict
with:
drivers/tty/serial/8250/8250_em.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/setlocalversion')
| -rwxr-xr-x | scripts/setlocalversion | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index e54839a42d4b..3d3babac8298 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -11,10 +11,16 @@ # usage() { - echo "Usage: $0 [srctree]" >&2 + echo "Usage: $0 [--no-local] [srctree]" >&2 exit 1 } +no_local=false +if test "$1" = "--no-local"; then + no_local=true + shift +fi + srctree=. if test $# -gt 0; then srctree=$1 @@ -26,14 +32,22 @@ fi scm_version() { - local short + local short=false + local no_dirty=false local tag - short=false + + while [ $# -gt 0 ]; + do + case "$1" in + --short) + short=true;; + --no-dirty) + no_dirty=true;; + esac + shift + done cd "$srctree" - if test "$1" = "--short"; then - short=true - fi if test -n "$(git rev-parse --show-cdup 2>/dev/null)"; then return @@ -75,6 +89,10 @@ scm_version() printf '%s%s' -g "$(echo $head | cut -c1-12)" fi + if ${no_dirty}; then + return + fi + # Check for uncommitted changes. # This script must avoid any write attempt to the source tree, which # might be read-only. @@ -110,11 +128,6 @@ collect_files() echo "$res" } -if ! test -e include/config/auto.conf; then - echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2 - exit 1 -fi - if [ -z "${KERNELVERSION}" ]; then echo "KERNELVERSION is not set" >&2 exit 1 @@ -126,6 +139,16 @@ if test ! "$srctree" -ef .; then file_localversion="${file_localversion}$(collect_files "$srctree"/localversion*)" fi +if ${no_local}; then + echo "${KERNELVERSION}$(scm_version --no-dirty)" + exit 0 +fi + +if ! test -e include/config/auto.conf; then + echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2 + exit 1 +fi + # version string from CONFIG_LOCALVERSION config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf) |
