2 # Ensure that du works properly for an argument that refers to a
3 # symbolic link, and that is specified with a trailing slash.
4 # Before coreutils-4.5.3, it would remove a single trailing slash.
6 if test "$VERBOSE" = yes; then
11 . $srcdir/../envvar-check
14 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
15 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
16 trap '(exit $?); exit $?' 1 2 13 15
19 mkdir -p $tmp || framework_failure=1
20 cd $tmp || framework_failure=1
21 mkdir -p dir/1/2 || framework_failure=1
22 ln -s dir slink || framework_failure=1
24 if test $framework_failure = 1; then
25 echo "$0: failure in testing framework" 1>&2
31 du slink/ | sed 's/^[0-9][0-9]* //' > out
34 # Ensure that with -L we get the same results (modulo the trailing slash
35 # on the third line) even without the trailing slash on the command line.
36 du -L slink | sed 's/^[0-9][0-9]* //' >> out
48 test $fail = 1 && diff out exp 2> /dev/null
50 (exit $fail); exit $fail