public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH 2/2] kbuild: package: add -e and -u options to shell scripts
Date: Sun, 16 Jun 2024 20:40:57 +0200	[thread overview]
Message-ID: <Zm8xuTWFx6SRAAHk@fjasle.eu> (raw)
In-Reply-To: <CAK7LNARPP_OsaOhUHT+5-vi5XJ36hDs0bNsiM7pwuAmj4S+MNg@mail.gmail.com>

On Mon, Jun 17, 2024 at 01:52:23AM +0900 Masahiro Yamada wrote:
> On Mon, Jun 17, 2024 at 12:56 AM Nicolas Schier <nicolas@fjasle.eu> wrote:
> >
> > 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@kernel.org> 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@kernel.org>
> > > > ---
> > >
> > >
> > >
> > > 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
> >  }
> >
> 
> 
> 
> 
> It depends on the code.
> 
> 
> 
> 
> I would fix
> 
> 
>    if [ -n "$KDEB_PKGVERSION" ]; then
> 
> 
> to
> 
>    if [ "${KDEB_PKGVERSION:+set}" = set ]; then
> 
> or
>    if [ "${KDEB_PKGVERSION:+set}" ]; then


ah, yes that's probaly better than the default value assigments,  Please ignore
my patch.

Kind regards,
Nicolas

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 16:08 [PATCH 1/2] kconfig: add -e and -u options to *conf-cfg.sh scripts Masahiro Yamada
2024-06-11 16:08 ` [PATCH 2/2] kbuild: package: add -e and -u options to shell scripts Masahiro Yamada
2024-06-12 19:33   ` Nicolas Schier
2024-06-16 15:21   ` Masahiro Yamada
2024-06-16 15:55     ` Nicolas Schier
2024-06-16 16:52       ` Masahiro Yamada
2024-06-16 18:40         ` Nicolas Schier [this message]
2024-06-12 19:28 ` [PATCH 1/2] kconfig: add -e and -u options to *conf-cfg.sh scripts 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=Zm8xuTWFx6SRAAHk@fjasle.eu \
    --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