public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: deb-pkg: use default string when variable is unset or null
@ 2024-07-04 15:23 Masahiro Yamada
  2024-07-05 17:05 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2024-07-04 15:23 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor, Nicolas Schier

${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>
---

 scripts/package/mkdebian | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 0cc1913aad30..196b14e8ad47 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -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}>"
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-05 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 15:23 [PATCH] kbuild: deb-pkg: use default string when variable is unset or null Masahiro Yamada
2024-07-05 17:05 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox