From: Jani Nikula <jani.nikula@linux.intel.com>
To: Petri Latvala <petri.latvala@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH i-g-t] igt_command_line.sh: Fix bashism
Date: Mon, 25 Sep 2017 14:48:41 +0300 [thread overview]
Message-ID: <87tvzr3so6.fsf@nikula.org> (raw)
In-Reply-To: <1506333262-30011-1-git-send-email-petri.latvala@intel.com>
On Mon, 25 Sep 2017, Petri Latvala <petri.latvala@intel.com> wrote:
> [[ a != b ]] is a bashism. As it's just comparing $1 to an empty
> string, use -n with a normal [ ].
>
> /bin/sh is dash in CI.
There's probably /bin/bash around anyway, but I'm tired of fighting the
fight. So never mind about that.
You could add shellcheck to your static checks, with a list of
exceptions of shellcheck tests you don't care about. It would tell you,
In igt_command_line.sh line 115:
if [[ "$1" != "" ]] ; then
^-- SC2039: In POSIX sh, [[ ]] is undefined.
BR,
Jani.
>
> Fixes: f0243a761f1b ("tests/igt_command_line.sh: Allow testing individual tests")
> CC: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> ---
> tests/igt_command_line.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
> index 57d105e9..a8baaaa1 100755
> --- a/tests/igt_command_line.sh
> +++ b/tests/igt_command_line.sh
> @@ -112,7 +112,7 @@ if [ $? -ne 0 ]; then
> exit 99
> fi
>
> -if [[ "$1" != "" ]] ; then
> +if [ -n "$1" ] ; then
> check_test $1
> exit 0
> fi
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-25 11:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 9:54 [PATCH i-g-t] igt_command_line.sh: Fix bashism Petri Latvala
2017-09-25 11:46 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-25 11:48 ` Jani Nikula [this message]
2017-09-26 12:01 ` [PATCH i-g-t] " Daniel Vetter
2017-09-26 12:27 ` Petri Latvala
2017-09-29 9:34 ` Joonas Lahtinen
2017-10-02 8:49 ` Daniel Vetter
2017-09-25 15:23 ` ✗ Fi.CI.IGT: warning for " Patchwork
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=87tvzr3so6.fsf@nikula.org \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
/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