1997-08-02 15:25:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
test=r-1
|
|
|
|
|
|
|
|
|
|
# TMPDIR should be an absolute dir for this test.
|
|
|
|
|
# FIXME: enforce it
|
|
|
|
|
: ${TMPDIR=/tmp}
|
|
|
|
|
|
|
|
|
|
if test "$VERBOSE" = yes; then
|
|
|
|
|
set -x
|
2000-06-12 08:34:00 +00:00
|
|
|
rm --version
|
1997-08-02 15:25:25 +00:00
|
|
|
fi
|
|
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
pwd=`pwd`
|
1997-08-02 15:25:25 +00:00
|
|
|
tmp=$TMPDIR/t-rm.$$
|
2000-06-12 08:42:08 +00:00
|
|
|
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
|
|
|
|
|
trap 'exit $?' 1 2 13 15
|
1997-08-02 15:25:25 +00:00
|
|
|
|
2000-06-14 16:53:36 +00:00
|
|
|
framework_failure=0
|
1998-01-22 08:33:02 +00:00
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
mkdir $tmp || framework_failure=1
|
|
|
|
|
mkdir $tmp/a $tmp/a/a || framework_failure=1
|
|
|
|
|
> $tmp/b || framework_failure=1
|
1998-01-22 08:33:02 +00:00
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
cat <<EOF > $tmp/$test.E || framework_failure=1
|
2000-07-30 18:44:43 +00:00
|
|
|
removing all entries of directory \`$tmp/a'
|
|
|
|
|
removing all entries of directory \`$tmp/a/a'
|
|
|
|
|
removing the directory itself: \`$tmp/a/a'
|
|
|
|
|
removing the directory itself: \`$tmp/a'
|
|
|
|
|
removing \`$tmp/b'
|
1998-01-22 08:33:02 +00:00
|
|
|
EOF
|
|
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
if test $framework_failure = 1; then
|
1998-01-22 08:33:02 +00:00
|
|
|
echo 'failure in testing framework'
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
1997-08-02 15:25:25 +00:00
|
|
|
|
1998-01-24 08:43:46 +00:00
|
|
|
LANGUAGE=C
|
|
|
|
|
export LANGUAGE
|
|
|
|
|
LANG=C
|
|
|
|
|
export LANG
|
|
|
|
|
|
1997-08-02 15:25:25 +00:00
|
|
|
fail=0
|
2000-06-12 08:34:00 +00:00
|
|
|
rm --verbose -r $tmp/a $tmp/b > $tmp/$test.O || fail=1
|
1997-08-02 15:25:25 +00:00
|
|
|
|
|
|
|
|
for d in $dirs; do
|
|
|
|
|
if test -d $d; then
|
|
|
|
|
fail=1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
1997-08-02 16:51:37 +00:00
|
|
|
# Compare expected and actual output.
|
|
|
|
|
cmp $tmp/$test.E $tmp/$test.O || fail=1
|
1997-08-02 15:25:25 +00:00
|
|
|
|
1997-08-16 17:40:57 +00:00
|
|
|
rm -rf $tmp
|
1997-08-02 15:25:25 +00:00
|
|
|
|
2000-06-12 08:42:08 +00:00
|
|
|
(exit $fail)
|
1997-08-02 15:25:25 +00:00
|
|
|
exit $fail
|