]> www.infradead.org Git - nvme.git/commitdiff
kbuild: deb-pkg: use default string when variable is unset or null
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 4 Jul 2024 15:23:32 +0000 (00:23 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 16 Jul 2024 07:07:14 +0000 (16:07 +0900)
${DEBFULLNAME-${user}} falls back to ${user} when DEBFULLNAME is unset.
It is more reasonable to do so when DEBFULLNAME is unset or null.

Otherwise, the command:

  $ DEBFULLNAME= make deb-pkg

will leave the name field blank.

The same applies to KBUILD_BUILD_USER and KBUILD_BUILD_HOST.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
scripts/package/mkdebian

index f962d303502b7a596233205caaf016ea87c27019..10637d403777697db10b6e3c3dba502045cd67be 100755 (executable)
@@ -125,12 +125,12 @@ gen_source ()
 rm -rf debian
 mkdir debian
 
-user=${KBUILD_BUILD_USER-$(id -nu)}
-name=${DEBFULLNAME-${user}}
+user=${KBUILD_BUILD_USER:-$(id -nu)}
+name=${DEBFULLNAME:-${user}}
 if [ "${DEBEMAIL:+set}" ]; then
        email=${DEBEMAIL}
 else
-       buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
+       buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)}
        email="${user}@${buildhost}"
 fi
 maintainer="${name} <${email}>"