mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: deb-pkg: Explicitly define optional user-defined variables
@ 2024-06-16 16:37 Nicolas Schier
  2024-06-16 18:46 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Schier @ 2024-06-16 16:37 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor; +Cc: linux-kbuild, linux-kernel

mkdebian supports some optional environment variables for controlling
the Debian package generation.  Declare those variables explicitly to
allow enabling of 'set -u' (error on unset variables).

Use of ': "${VAR:=}"' for variable assignment is POSIX compatible [1].

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#colon

Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
---
 scripts/package/mkdebian | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 070149c985fe..81e81906ad07 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -6,6 +6,18 @@
 
 set -e
 
+# Optional user-specified environment variables
+
+# Set target Debian architecture (skip auto-detection)
+: "${KBUILD_DEBARCH:=}"
+
+# Set target Debian distribution (skipping auto-detection)
+: "${KDEB_CHANGELOG_DIST:=}"
+
+# Overwrite the automatically determined package version.
+: "${KDEB_PKGVERSION:=}"
+
+
 is_enabled() {
 	grep -q "^$1=y" include/config/auto.conf
 }
-- 
2.39.2


-- 
epost|xmpp: nicolas@fjasle.eu          irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb  c82b 7d97 0932 55a0 ce7f
     -- frykten for herren er opphav til kunnskap --

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

* Re: [PATCH] kbuild: deb-pkg: Explicitly define optional user-defined variables
  2024-06-16 16:37 [PATCH] kbuild: deb-pkg: Explicitly define optional user-defined variables Nicolas Schier
@ 2024-06-16 18:46 ` Nicolas Schier
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Schier @ 2024-06-16 18:46 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor; +Cc: linux-kbuild, linux-kernel

On Sun, Jun 16, 2024 at 06:37:16PM +0200 Nicolas Schier wrote:
> mkdebian supports some optional environment variables for controlling
> the Debian package generation.  Declare those variables explicitly to
> allow enabling of 'set -u' (error on unset variables).
> 
> Use of ': "${VAR:=}"' for variable assignment is POSIX compatible [1].
> 
> [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#colon
> 
> Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
> ---
>  scripts/package/mkdebian | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> index 070149c985fe..81e81906ad07 100755
> --- a/scripts/package/mkdebian
> +++ b/scripts/package/mkdebian
> @@ -6,6 +6,18 @@
>  
>  set -e
>  
> +# Optional user-specified environment variables
> +
> +# Set target Debian architecture (skip auto-detection)
> +: "${KBUILD_DEBARCH:=}"
> +
> +# Set target Debian distribution (skipping auto-detection)
> +: "${KDEB_CHANGELOG_DIST:=}"
> +
> +# Overwrite the automatically determined package version.
> +: "${KDEB_PKGVERSION:=}"
> +
> +
>  is_enabled() {
>  	grep -q "^$1=y" include/config/auto.conf
>  }
> -- 
> 2.39.2


Please ignore, cp. https://lore.kernel.org/linux-kbuild/CAK7LNARPP_OsaOhUHT+5-vi5XJ36hDs0bNsiM7pwuAmj4S+MNg@mail.gmail.com/

Sorry for the noise.

Kind regards,
Nicolas


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

end of thread, other threads:[~2024-06-16 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-16 16:37 [PATCH] kbuild: deb-pkg: Explicitly define optional user-defined variables Nicolas Schier
2024-06-16 18:46 ` Nicolas Schier

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

all inboxes | Powered by JetHome®