setlocalversion: simplify the construction of the short version
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 22 Jan 2023 14:14:22 +0000 (23:14 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 5 Feb 2023 09:34:11 +0000 (18:34 +0900)
With the --short option given, scm_version() prints "+".
Just append it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
scripts/setlocalversion

index 3b31702..5cdf409 100755 (executable)
@@ -121,8 +121,7 @@ elif [ "${LOCALVERSION+set}" != "set" ]; then
        #
        # 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)
-       res="$res${scm:++}"
+       res="$res$(scm_version --short)"
 fi
 
 echo "$res"