mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: deb-pkg: Explicitly define optional user-defined variables
Date: Sun, 16 Jun 2024 18:37:16 +0200	[thread overview]
Message-ID: <20240616-sensible-celadon-hog-0b0dea@lindesnes> (raw)

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

             reply	other threads:[~2024-06-16 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16 16:37 Nicolas Schier [this message]
2024-06-16 18:46 ` Nicolas Schier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240616-sensible-celadon-hog-0b0dea@lindesnes \
    --to=nicolas@fjasle.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®