From: Paul Eggert Date: Sun, 19 Dec 2010 04:02:45 +0000 (-0800) Subject: tests: sync init.sh from gnulib X-Git-Tag: v8.8~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5947491895ae37c68941a36960face05269b5a85;p=thirdparty%2Fcoreutils.git tests: sync init.sh from gnulib * tests/init.sh (setup_): Initialize fail=0 before invoking mktempd_. Ensure that IFS is defined initially. (mktempd_): Remove fail=0 initialization; no longer needed. --- diff --git a/tests/init.sh b/tests/init.sh index 7be5e9e8aa..4d89a1af6d 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -324,21 +324,25 @@ setup_() fi initial_cwd_=$PWD + fail=0 pfx_=`testdir_prefix_` test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ || fail_ "failed to create temporary directory in $initial_cwd_" cd "$test_dir_" + # As autoconf-generated configure scripts do, ensure that IFS + # is defined initially, so that saving and restoring $IFS works. + gl_init_sh_nl_=' +' + IFS=" "" $gl_init_sh_nl_" + # This trap statement, along with a trap on 0 below, ensure that the # temporary directory, $test_dir_, is removed upon exit as well as # upon receipt of any of the listed signals. for sig_ in 1 2 3 13 15; do eval "trap 'Exit $(expr $sig_ + 128)' $sig_" done - - # Set up for the "Exit $fail" at the end of many tests. - fail=0 } # Create a temporary directory, much like mktemp -d does. @@ -413,8 +417,6 @@ mktempd_() *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";; esac - fail=0 - # First, try to use mktemp. d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \ || fail=1