scripts/setlocalversion: simplify the short version part
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 23 May 2021 03:14:28 +0000 (12:14 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 May 2021 19:01:51 +0000 (04:01 +0900)
Reduce the indentation.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nico Schottelius <nico-linuxsetlocalversion@schottelius.org>
scripts/setlocalversion

index 62c0bcc..151f049 100755 (executable)
@@ -131,15 +131,13 @@ res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}"
 if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
        # full scm version string
        res="$res$(scm_version)"
-else
+elif [ -z "${LOCALVERSION}" ]; then
        # append a plus sign if the repository is not in a clean
        # annotated or signed tagged state (as git describe only
        # looks at signed or annotated tags - git tag -a/-s) and
        # LOCALVERSION= is not specified
-       if test "${LOCALVERSION+set}" != "set"; then
-               scm=$(scm_version --short)
-               res="$res${scm:++}"
-       fi
+       scm=$(scm_version --short)
+       res="$res${scm:++}"
 fi
 
 echo "$res"