diff mbox

[i-g-t,v2] assembler: Fix bashism in run-test.sh

Message ID 20171030130941.24538-1-rhyskidd@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rhys Kidd Oct. 30, 2017, 1:09 p.m. UTC
[[ a != b ]] is a bashism. As it's just comparing $1 to an empty string,
use -n with a normal [ ].

Noticed whilst testing meson builds. /bin/sh is apparently dash in Intel's CI.

v2:
 - keep this as a /bin/sh script (Joonas Lahtinen)

Fixes: c3863e19 ("assembler/test: Prep work for meson")
CC: Daniel Vetter <daniel.vetter@ffwll.ch>
CC: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
---
 assembler/test/run-test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arkadiusz Hiler Oct. 30, 2017, 5:59 p.m. UTC | #1
On Mon, Oct 30, 2017 at 09:09:41AM -0400, Rhys Kidd wrote:
> [[ a != b ]] is a bashism. As it's just comparing $1 to an empty string,
> use -n with a normal [ ].
> 
> Noticed whilst testing meson builds. /bin/sh is apparently dash in Intel's CI.
> 
> v2:
>  - keep this as a /bin/sh script (Joonas Lahtinen)
> 
> Fixes: c3863e19 ("assembler/test: Prep work for meson")
> CC: Daniel Vetter <daniel.vetter@ffwll.ch>
> CC: Petri Latvala <petri.latvala@intel.com>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>

Thanks for patch and the review!
Pushed.
diff mbox

Patch

diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index 0a5252a8..b06e1044 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/test/run-test.sh
@@ -5,7 +5,7 @@  BUILDDIR=${top_builddir-`pwd`}
 
 test="TEST"
 
-if [[ "$1" != "" ]] ; then
+if [ -n "$1" ] ; then
 	test="$1"
 fi