2 # Ensure "ls --color" properly colors other-writable and sticky directories.
3 # Before coreutils-6.2, this test would fail, coloring all three
4 # directories the same as the first one -- but only on a file system
5 # with dirent.d_type support.
7 # Copyright (C) 2006 Free Software Foundation, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 if test "$VERBOSE" = yes; then
29 . $srcdir/../envvar-check
32 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
33 trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
34 trap '(exit $?); exit $?' 1 2 13 15
37 mkdir -p $tmp || framework_failure=1
38 cd $tmp || framework_failure=1
40 mkdir d other-writable sticky || framework_failure=1
41 chmod o+w other-writable || framework_failure=1
42 chmod o+t sticky || framework_failure=1
44 if test $framework_failure = 1; then
45 echo "$0: failure in testing framework" 1>&2
51 ls --color=always > out || fail=1
52 cat -A out > o1 || fail=1
56 cat <<\EOF > exp || fail=1
58 ^[[34;42mother-writable^[[0m$
65 test $fail = 1 && diff out exp 2> /dev/null
67 (exit $fail); exit $fail