[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cygwin failing tests/mv/mv-special-1
From: |
Paul Eggert |
Subject: |
Re: cygwin failing tests/mv/mv-special-1 |
Date: |
Thu, 14 Apr 2005 13:37:24 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Thanks for that bug report. I installed this patch: does it fix both
your problems?
2005-04-14 Paul Eggert <address@hidden>
Fix test suite problems reported by Eric Blake on Cygwin.
* tests/mv/mv-special-1: Ignore chatter about when files are removed,
since POSIX doesn't require rename to fail across file systems.
* tests/mv/setup (dot_mount_point): Use stat rather than df, as
it's more reliable.
(other_partition_tmpdir): Remove df from name as that would be
misleading now.
Index: tests/mv/mv-special-1
===================================================================
RCS file: /fetish/cu/tests/mv/mv-special-1,v
retrieving revision 1.23
diff -p -u -r1.23 mv-special-1
--- tests/mv/mv-special-1 23 Jun 2004 15:07:04 -0000 1.23
+++ tests/mv/mv-special-1 14 Apr 2005 20:26:00 -0000
@@ -50,11 +50,15 @@ test -d $dir && fail=1
ls $other_partition_tmpdir/$null > /dev/null || fail=1
test -d $other_partition_tmpdir/$dir/a/b/c || fail=1
-sed "s,$other_partition_tmpdir,XXX," out | sort > out2
+# POSIX says rename (A, B) can succeed if A and B are on different file
systems,
+# so ignore chatter about when files are removed and copied rather than
renamed.
+sed "
+ /^removed /d
+ s,$other_partition_tmpdir,XXX,
+" out | sort > out2
cat <<EOF | sort > exp
\`$null' -> \`XXX/$null'
-removed \`$null'
\`$dir' -> \`XXX/$dir'
\`$dir/a' -> \`XXX/$dir/a'
\`$dir/a/b' -> \`XXX/$dir/a/b'
@@ -64,15 +68,6 @@ removed \`$null'
\`$dir/d/e' -> \`XXX/$dir/d/e'
\`$dir/d/e/f' -> \`XXX/$dir/d/e/f'
\`$dir/d/e/f/file2' -> \`XXX/$dir/d/e/f/file2'
-removed directory: \`$dir'
-removed \`$dir/a/b/c/file1'
-removed \`$dir/d/e/f/file2'
-removed directory: \`$dir/a'
-removed directory: \`$dir/a/b'
-removed directory: \`$dir/a/b/c'
-removed directory: \`$dir/d'
-removed directory: \`$dir/d/e'
-removed directory: \`$dir/d/e/f'
EOF
cmp out2 exp || fail=1
Index: tests/mv/setup
===================================================================
RCS file: /fetish/cu/tests/mv/setup,v
retrieving revision 1.12
diff -p -u -r1.12 setup
--- tests/mv/setup 20 Aug 2002 16:53:33 -0000 1.12
+++ tests/mv/setup 14 Apr 2005 20:26:00 -0000
@@ -1,6 +1,6 @@
#! /bin/sh
-# Use df to find a writable directory on a file system different from that
+# Use stat to find a writable directory on a file system different from that
# of the current directory. If one is found, create a temporary directory
# inside it.
@@ -9,22 +9,20 @@ test "${CANDIDATE_TMP_DIRS+set}" = set \
other_partition_tmpdir=
-# WARNING: using sed like this to extract the mount point will fail
-# if the mount point name contains `% '.
-dot_mount_point=`df --no-sync -P . | sed -n '2s/.*% *//p'`
+dot_mount_point=`stat -c %d .`
for d in $CANDIDATE_TMP_DIRS; do
# Skip nonexistent directories.
test -d $d || continue
- d_mount_point=`df --no-sync -P $d | sed -n '2s/.*% *//p'`
+ d_mount_point=`stat -c %d $d`
# Same partition? Skip it.
test x$d_mount_point = x$dot_mount_point && continue
# See if we can create a directory in it.
- if mkdir "$d/df-$$" > /dev/null 2>&1; then
- other_partition_tmpdir="$d/df-$$"
+ if mkdir "$d/tmp$$" > /dev/null 2>&1; then
+ other_partition_tmpdir="$d/tmp$$"
break
fi