<p>Acked-by: Grant Likely <<a href="mailto:grant.likely@secretlab.ca">grant.likely@secretlab.ca</a>></p>
<p>On Aug 29, 2010 8:53 PM, "David Gibson" <<a href="mailto:david@gibson.dropbear.id.au">david@gibson.dropbear.id.au</a>> wrote:<br type="attribution">> Current we check for various error codes with [ $x == "NN" ].  However<br>
> '==' is not actually a correct operator for the [ (test) command.  It<br>> should be either '=' for string comparison or '-eq' for integer<br>> comparison.  It appears that the bash builtin version of test<br>
> implements '==' though, so we were getting away with it, as long as<br>> /bin/sh was bash - or the testsuite generated no errors.<br>> <br>> This patch fixes the usage of test so that it should work on non-bash<br>
> shells.<br>> <br>> Signed-off-by: David Gibson <<a href="mailto:david@gibson.dropbear.id.au">david@gibson.dropbear.id.au</a>><br>> <br>> Index: dtc/tests/run_tests.sh<br>> ===================================================================<br>
> --- dtc.orig/tests/run_tests.sh    2010-08-30 12:43:03.133784380 +1000<br>> +++ dtc/tests/run_tests.sh    2010-08-30 12:43:34.741770203 +1000<br>> @@ -24,11 +24,11 @@ base_run_test() {<br>>   tot_pass=$((tot_pass + 1))<br>
>      else<br>>    ret="$?"<br>> -      if [ "$ret" == "1" ]; then<br>> +  if [ "$ret" -eq 1 ]; then<br>>           tot_config=$((tot_config + 1))<br>> -      elif [ "$ret" == "2" ]; then<br>
> +  elif [ "$ret" -eq 2 ]; then<br>>         tot_fail=$((tot_fail + 1))<br>> -  elif [ "$ret" == "$VGCODE" ]; then<br>> +  elif [ "$ret" -eq $VGCODE ]; then<br>>           tot_vg=$((tot_vg + 1))<br>
>    else<br>>          tot_strange=$((tot_strange + 1))<br>> <br>> -- <br>> David Gibson                        | I'll have my music baroque, and my code<br>> david AT <a href="http://gibson.dropbear.id.au">gibson.dropbear.id.au</a>     | minimalist, thank you.  NOT _the_ _other_<br>
>                            | _way_ _around_!<br>> <a href="http://www.ozlabs.org/~dgibson">http://www.ozlabs.org/~dgibson</a><br>> _______________________________________________<br>> devicetree-discuss mailing list<br>> <a href="mailto:devicetree-discuss@lists.ozlabs.org">devicetree-discuss@lists.ozlabs.org</a><br>
> <a href="https://lists.ozlabs.org/listinfo/devicetree-discuss">https://lists.ozlabs.org/listinfo/devicetree-discuss</a><br></p>