[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils 6.0
From: |
Jim Meyering |
Subject: |
Re: coreutils 6.0 |
Date: |
Wed, 16 Aug 2006 11:38:28 +0200 |
Michael Stone <address@hidden> wrote:
> On Wed, Aug 16, 2006 at 08:18:27AM +0200, Jim Meyering wrote:
>>What version of Linux is that?
>
> 2.6.17
>
>>From the name of the directory, it's probably a tmpfs file system.
>
> actually it's xfs. it's inside a pbuilder chroot, so the mtab is going
> to be completely bogus (I think mount would report /tmp as being tmpfs,
> as that's the case in the real root.)
Ok. Then I'll use a more robust test for file system type.
This also relaxes the test to run if "." is an ext2 file system.
Does this patch solve the problem?
2006-08-16 Jim Meyering <address@hidden>
* tests/ls/stat-dtype: Use stat to test file system type, rather
than df -T, in case /etc/mtab lies. Reported by Michael Stone.
Index: tests/ls/stat-dtype
===================================================================
RCS file: /fetish/cu/tests/ls/stat-dtype,v
retrieving revision 1.4
diff -u -p -r1.4 stat-dtype
--- tests/ls/stat-dtype 10 Aug 2006 09:22:33 -0000 1.4
+++ tests/ls/stat-dtype 16 Aug 2006 09:34:58 -0000
@@ -16,8 +16,9 @@ fi
# linux-2.6.15, at least tmpfs and ext3 work, but reiserfs and xfs don't.
# Also, tmpfs on Solaris 10 lacks d_type support.
skip=yes
-test `uname -s` = Linux && df -t tmpfs . > /dev/null 2>&1 && skip=no
-df -t ext3 . > /dev/null 2>&1 && skip=no
+fs_type=`stat -f --printf %T .`
+test `uname -s` = Linux && test $fs_type = tmpfs && skip=no
+test $fs_type = ext2/ext3 && skip=no
test $skip = yes &&
{
echo "$0: '.' is not on a suitable file system for this test" 1>&2