Message ID | 20171029002018.21167-1-rhyskidd@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, 2017-10-28 at 20:20 -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. > > Also change the script to #!/bin/bash to avoid having to babysit bashism later. Just leave the shebang as it is, then this is; Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Regards, Joonas
diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh index 0a5252a8..b5e245bc 100644 --- a/assembler/test/run-test.sh +++ b/assembler/test/run-test.sh @@ -1,11 +1,11 @@ -#!/bin/sh +#!/bin/bash SRCDIR=${srcdir-`pwd`} BUILDDIR=${top_builddir-`pwd`} test="TEST" -if [[ "$1" != "" ]] ; then +if [ -n "$1" ] ; then test="$1" fi
[[ 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. Also change the script to #!/bin/bash to avoid having to babysit bashism later. Fixes: c3863e19 ("assembler/test: Prep work for meson") CC: Daniel Vetter <daniel.vetter@ffwll.ch> CC: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Rhys Kidd <rhyskidd@gmail.com> --- assembler/test/run-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)