* [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* Re: [PATCH] kbuild: deb-pkg: use default string when variable is unset or null
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
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2024-07-05 17:05 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel, Nicolas Schier
On Fri, Jul 05, 2024 at 12:23:32AM +0900, Masahiro Yamada wrote:
> ${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>
Yeah, it definitely does not really make sense to let someone do that,
although I am not really sure why anyone would...
Reviewed-by: Nathan Chancellor <nathan@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 [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