History

scripts/setlocalversion: fix a bug when LOCALVERSION is empty

The commit 042da426f8eb ("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.

Mikulas Patocka committed 5 years ago

Commit 5df99be1 parent e73f0f01 file · +8 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/setlocalversion+8−5
@@ -131,11 +131,14 @@ res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" · 130 unmodified lines
131if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then131if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
132 # full scm version string132 # full scm version string
133 res="$res$(scm_version)"133 res="$res$(scm_version)"
134elif [ -z "${LOCALVERSION}" ]; then134elif [ "${LOCALVERSION+set}" != "set" ]; then
135 # append a plus sign if the repository is not in a clean135 # If the variable LOCALVERSION is not set, append a plus
136 # annotated or signed tagged state (as git describe only136 # sign if the repository is not in a clean annotated or
137 # looks at signed or annotated tags - git tag -a/-s) and137 # signed tagged state (as git describe only looks at signed
138 # LOCALVERSION= is not specified138 # or annotated tags - git tag -a/-s).
139 #
140 # If the variable LOCALVERSION is set (including being set
141 # to an empty string), we don't want to append a plus sign.
139 scm=$(scm_version --short)142 scm=$(scm_version --short)
140 res="$res${scm:++}"143 res="$res${scm:++}"
141fi144fi