Commit 5df99bec authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Masahiro Yamada

scripts/setlocalversion: fix a bug when LOCALVERSION is empty

The commit 042da426 ("scripts/setlocalversion: simplify the short
version part") reduces indentation. Unfortunately, it also changes behavior
in a subtle way - if the user has empty "LOCALVERSION" variable, the plus
sign is appended to the kernel version. It wasn't appended before.

This patch reverts to the old behavior - we append the plus sign only if
the LOCALVERSION variable is not set.

Fixes: 042da426 ("scripts/setlocalversion: simplify the short version part")
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent e73f0f0e
...@@ -131,11 +131,14 @@ res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" ...@@ -131,11 +131,14 @@ res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}"
if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
# full scm version string # full scm version string
res="$res$(scm_version)" res="$res$(scm_version)"
elif [ -z "${LOCALVERSION}" ]; then elif [ "${LOCALVERSION+set}" != "set" ]; then
# append a plus sign if the repository is not in a clean # If the variable LOCALVERSION is not set, append a plus
# annotated or signed tagged state (as git describe only # sign if the repository is not in a clean annotated or
# looks at signed or annotated tags - git tag -a/-s) and # signed tagged state (as git describe only looks at signed
# LOCALVERSION= is not specified # or annotated tags - git tag -a/-s).
#
# If the variable LOCALVERSION is set (including being set
# to an empty string), we don't want to append a plus sign.
scm=$(scm_version --short) scm=$(scm_version --short)
res="$res${scm:++}" res="$res${scm:++}"
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment