[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coreutils] [PATCH] tests: sync init.sh from gnulib
From: |
Paul Eggert |
Subject: |
[coreutils] [PATCH] tests: sync init.sh from gnulib |
Date: |
Sat, 18 Dec 2010 20:04:20 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
* tests/init.sh (setup_): Initialize fail=0 before invoking mktempd_.
Ensure that IFS is defined initially.
(mktempd_): Remove fail=0 initialization; no longer needed.
---
tests/init.sh | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/init.sh b/tests/init.sh
index 7be5e9e..4d89a1a 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
--
1.7.2
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [coreutils] [PATCH] tests: sync init.sh from gnulib,
Paul Eggert <=