linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: "Dirk Müller" <dmueller@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] scripts/dev-needs: depend on bash in shebang
Date: Mon, 14 Mar 2022 15:30:10 -0700	[thread overview]
Message-ID: <CAGETcx_6BGXFfF1ZHH_=Gq1vp8quFzyLNSCjtfTakJfQE-7Nyw@mail.gmail.com> (raw)
In-Reply-To: <20220314221703.30910-1-dmueller@suse.de>

Adding LKML

On Mon, Mar 14, 2022 at 3:17 PM Dirk Müller <dmueller@suse.de> wrote:
>
> This script uses bash specific syntax. make it more specific by
> declaring it to be used via bash rather than /bin/sh which could
> be non-bash.
>
> Signed-off-by: Dirk Müller <dmueller@suse.de>

Technically this is targeted towards toybox because that's what I deal
with everyday while I work on Android devices. But toybox seems to
follow bash conventions. Would this shebang be considered valid in
that instance?

Btw, I've been meaning to add (for more than year) the following to
the top of the script:
shopt -s expand_aliases

Geert pointed out that the script doesn't work with some setups
because this flag isn't default enabled. I also remember this being a
deprecated option, but until someone wants to rewrite this script in a
way that it'll work on toybox (this is what Android uses) with zero
setup and also not depend on the aliases, we might as well set the
flag to match with reality.

Wanna pull that shopt into your patch?

-Saravana

> ---
>  scripts/dev-needs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/dev-needs.sh b/scripts/dev-needs.sh
> index 454cc304fb44..c324f0737f6b 100755
> --- a/scripts/dev-needs.sh
> +++ b/scripts/dev-needs.sh
> @@ -1,4 +1,4 @@
> -#! /bin/sh
> +#!/bin/bash
>  # SPDX-License-Identifier: GPL-2.0
>  # Copyright (c) 2020, Google LLC. All rights reserved.
>  # Author: Saravana Kannan <saravanak@google.com>
> --
> 2.35.1
>

On Mon, Mar 14, 2022 at 3:17 PM Dirk Müller <dmueller@suse.de> wrote:
>
> This script uses bash specific syntax. make it more specific by
> declaring it to be used via bash rather than /bin/sh which could
> be non-bash.
>
> Signed-off-by: Dirk Müller <dmueller@suse.de>
> ---
>  scripts/dev-needs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/dev-needs.sh b/scripts/dev-needs.sh
> index 454cc304fb44..c324f0737f6b 100755
> --- a/scripts/dev-needs.sh
> +++ b/scripts/dev-needs.sh
> @@ -1,4 +1,4 @@
> -#! /bin/sh
> +#!/bin/bash
>  # SPDX-License-Identifier: GPL-2.0
>  # Copyright (c) 2020, Google LLC. All rights reserved.
>  # Author: Saravana Kannan <saravanak@google.com>
> --
> 2.35.1
>

           reply	other threads:[~2022-03-14 22:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20220314221703.30910-1-dmueller@suse.de>]

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='CAGETcx_6BGXFfF1ZHH_=Gq1vp8quFzyLNSCjtfTakJfQE-7Nyw@mail.gmail.com' \
    --to=saravanak@google.com \
    --cc=dmueller@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).