2 # make sure du's --exclude option works
4 if test "$VERBOSE" = yes; then
9 . $srcdir/../envvar-check
12 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
13 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
14 trap '(exit $?); exit $?' 1 2 13 15
17 mkdir -p $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
19 mkdir -p a/b/c a/x/y a/u/v
21 if test $framework_failure = 1; then
22 echo "$0: failure in testing framework" 1>&2
28 du --exclude=x a | sed 's/^[0-9][0-9]* //' | sort > out || fail=1
31 du --exclude-from=excl a | sed 's/^[0-9][0-9]* //' | sort >> out || fail=1
33 # Make sure that we can exclude an entire hierarchy.
34 du --exclude=a a >> out || fail=1
35 # Make sure that we can exclude based on more than one component.
36 # Before coreutils-5.3.0, this part would fail.
38 du --exclude=a/u --exclude=a/b a \
39 | sed 's/^[0-9][0-9]* //' | sort >> out || fail=1
60 test $fail = 1 && diff out exp 2> /dev/null
62 (exit $fail); exit $fail