This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] make io/ftwtest-sh use TMPDIR variable consistently
- From: "Kevin P. Fleming" <kpfleming at backtobasicsmgmt dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 27 Jan 2004 21:48:11 -0700
- Subject: [PATCH] make io/ftwtest-sh use TMPDIR variable consistently
- Organization: Back to Basics Network Management
The io/ftwtest-sh script uses TMPDIR, if it is set, to hold the directory
for its tests instead of /tmp. It passes this patch to the ftwtest program
and compares the results against pre-defined expected results embedded in
the script. Most of these pre-defined results use $tmp to refer to this
computed path, but some of them do not. The ones that do not cause failures
when TMPDIR is set to something other than /tmp, because they expect the paths
to start with /tmp. The patch below corrects this behavior and makes all of the
tests in the script use the same starting path for their comparisons.
2004-01-27 Kevin P. Fleming <kpfleming@backtobasicsmgmt.com>
* io/ftwtest-sh: make script use $tmp variable consistently for all tests
--- glibc-2/io/ftwtest-sh Tue Jan 27 21:36:27 2004
+++ glibc-fix-ftwtest-patch/io/ftwtest-sh Tue Jan 27 21:36:50 2004
@@ -211,16 +211,16 @@
sort > $testout
cat <<EOF | diff -u $testout - || exit 1
-base = "/tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "/tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "/tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
EOF
rm $testout
@@ -235,16 +235,16 @@
&& catcmd="grep -v lvl1b"
$catcmd <<EOF | diff -u $testout - || exit 1
-base = "/tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "/tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "/tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
EOF
rm $testout
@@ -254,28 +254,28 @@
# The filesystem is not required to put file2@1b and file3@1b after file@1b.
# If file[23]@1b come after file@1b, it shouldn't be printed, while if they
# come before, they should.
-regexp=`echo $(ls -U /tmp/ftwtest.d/foo/lvl1b \
+regexp=`echo $(ls -U $tmp/ftwtest.d/foo/lvl1b \
| sed -n '/file@1b$/,${/file[23]@1b$/p;}') | sed 's, ,|,'`
catcmd=cat
[ -n "$regexp" ] && catcmd="egrep -v $regexp"
$catcmd <<EOF | diff -u $testout - || exit 1
-base = "/tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "/tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "/tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "/tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "/tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "/tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
EOF
rm $testout