netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] check-tree.sh: check and flag /bin/sh usage
Date: Tue, 24 Oct 2023 12:47:26 +0200	[thread overview]
Message-ID: <ZTegvleAvSb4mNUg@calendula> (raw)
In-Reply-To: <20231024104044.18669-1-fw@strlen.de>

On Tue, Oct 24, 2023 at 12:40:40PM +0200, Florian Westphal wrote:
> Almost all shell tests use /bin/bash already.
> 
> In some cases we've had shell tests use /bin/sh, but still having
> a bashism.  This causes failures on systems where sh is dash or another,
> strict bourne shell.
> 
> Flag those via check-tree.sh.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  tests/shell/testcases/sets/elem_opts_compat_0 | 2 +-
>  tools/check-tree.sh                           | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/shell/testcases/sets/elem_opts_compat_0 b/tests/shell/testcases/sets/elem_opts_compat_0
> index e0129536fcb7..3467cc07e646 100755
> --- a/tests/shell/testcases/sets/elem_opts_compat_0
> +++ b/tests/shell/testcases/sets/elem_opts_compat_0
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
>  
>  # ordering of element options and expressions has changed, make sure parser
>  # accepts both ways

Amend before applying, I was too fast to push out the fix for
elem_opts_compat_0.

Thanks.

> diff --git a/tools/check-tree.sh b/tools/check-tree.sh
> index c3aaa08d05ce..e3ddf8bdea58 100755
> --- a/tools/check-tree.sh
> +++ b/tools/check-tree.sh
> @@ -68,6 +68,7 @@ if [ "${#SHELL_TESTS[@]}" -eq 0 ] ; then
>  fi
>  for t in "${SHELL_TESTS[@]}" ; do
>  	check_shell_dumps "$t"
> +	head -n 1 "$t" |grep -q  '^#!/bin/sh' && echo "$t uses sh instead of bash" && EXIT_CODE=1
>  done
>  
>  ##############################################################################
> -- 
> 2.41.0
> 

      reply	other threads:[~2023-10-24 10:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 10:40 [PATCH nft] check-tree.sh: check and flag /bin/sh usage Florian Westphal
2023-10-24 10:47 ` Pablo Neira Ayuso [this message]

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=ZTegvleAvSb4mNUg@calendula \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@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).