From: Jim Meyering Date: Mon, 8 Sep 2008 06:23:37 +0000 (+0200) Subject: tests: don't use "local" in bourne shell scripts X-Git-Tag: v7.0~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1084bf78eafe4de0d8f0752a638be97e26157ea1;p=platform%2Fupstream%2Fcoreutils.git tests: don't use "local" in bourne shell scripts * tests/test-lib.sh (remove_tmp_, skip_if_mcstransd_is_running_): Avoid failure on Solaris 11, since their /bin/sh passes the tests in posix-shell.m4, yet does not support "local" (which is not POSIX). --- diff --git a/tests/test-lib.sh b/tests/test-lib.sh index e7ec80e..ceb4eb6 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -246,11 +246,11 @@ skip_if_mcstransd_is_running_() # When mcstransd is running, you'll see only the 3-component # version of file-system context strings. Detect that, # and if it's running, skip this test. - local ctx=$(stat --printf='%C\n' .) || framework_failure - case $ctx in + __ctx=$(stat --printf='%C\n' .) || framework_failure + case $__ctx in *:*:*:*) ;; # four components is ok *) # anything else probably means mcstransd is running - skip_test_ "unexpected context '$ctx'; turn off mcstransd" ;; + skip_test_ "unexpected context '$__ctx'; turn off mcstransd" ;; esac } @@ -298,9 +298,9 @@ t_=$("$abs_top_builddir/src/mktemp" -d --tmp="$test_dir_" cu-$this_test.XXXXXXXX remove_tmp_() { - local st=$? + __st=$? cleanup_ - cd "$test_dir_" && chmod -R u+rwx "$t_" && rm -rf "$t_" && exit $st + cd "$test_dir_" && chmod -R u+rwx "$t_" && rm -rf "$t_" && exit $__st } # Run each test from within a temporary sub-directory named after the