Re: [PATCH 2/2] kbuild: package: add -e and -u options to shell scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 17, 2024 at 12:21:15AM +0900, Masahiro Yamada wrote:
> On Wed, Jun 12, 2024 at 1:09 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > Set -e to make these scripts fail on the first error.
> >
> > Set -u because these scripts are invoked by Makefile, and do not work
> > properly without necessary variables defined.
> >
> > Remove the explicit "test -n ..." from scripts/package/install-extmod-build.
> >
> > Both options are described in POSIX. [1]
> >
> > [1]: https://pubs.opengroup.org/onlinepubs/009604499/utilities/set.html
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> > ---
> 
> 
> 
> Setting -u needs more careful review and test.
> 
> 
> This patch will break 'make deb-pkg'.
> 
> 
> ./scripts/package/mkdebian: 150: KDEB_PKGVERSION: parameter not set
> 
> 
> 
> 
> To set -u, scripts/package/mkdebian needs code refactoring.
> 
> 
> 
> I will keep scripts/package/mkdebian untouched.

uh, I missed that during the review.  Do you want to refactor mkdebian
in large scale, or is an explicit fallback definition possibly
acceptable for you?

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index ecfeb34b99aa..7e3878197041 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -7,5 +7,17 @@
 set -eu
 
+# 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
 }



Kind regards,
Nicolas

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux