[Crosstoolchain-logs] [device-tree-compiler] 351/357: Remove another bashism from run_tests.sh

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.3.x
in repository device-tree-compiler.

commit 390635762d97502bda9c295fcb61b45d04d3d8d2
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Mon Aug 30 12:53:03 2010 +1000

    Remove another bashism from run_tests.sh
    
    Current we check for various error codes with [ $x == "NN" ].  However
    '==' is not actually a correct operator for the [ (test) command.  It
    should be either '=' for string comparison or '-eq' for integer
    comparison.  It appears that the bash builtin version of test
    implements '==' though, so we were getting away with it, as long as
    /bin/sh was bash - or the testsuite generated no errors.
    
    This patch fixes the usage of test so that it should work on non-bash
    shells.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 tests/run_tests.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 4cec62c..c2c39b6 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -24,11 +24,11 @@ base_run_test() {
 	tot_pass=$((tot_pass + 1))
     else
 	ret="$?"
-	if [ "$ret" == "1" ]; then
+	if [ "$ret" -eq 1 ]; then
 	    tot_config=$((tot_config + 1))
-	elif [ "$ret" == "2" ]; then
+	elif [ "$ret" -eq 2 ]; then
 	    tot_fail=$((tot_fail + 1))
-	elif [ "$ret" == "$VGCODE" ]; then
+	elif [ "$ret" -eq $VGCODE ]; then
 	    tot_vg=$((tot_vg + 1))
 	else
 	    tot_strange=$((tot_strange + 1))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list