1997-08-31 22:15:57 +00:00
|
|
|
#!/bin/sh
|
1998-01-22 08:32:22 +00:00
|
|
|
# Make sure that rm -r '' fails.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
|
|
|
|
# Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
# 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
|
1998-01-22 08:32:22 +00:00
|
|
|
# On SunOS 4.1.3, running rm -r '' in a nonempty directory may
|
1997-09-28 16:33:22 +00:00
|
|
|
# actually remove files with names of entries in the current directory
|
|
|
|
|
# but relative to `/' rather than relative to the current directory.
|
1997-08-31 22:15:57 +00:00
|
|
|
|
|
|
|
|
if test "$VERBOSE" = yes; then
|
|
|
|
|
set -x
|
2002-04-19 22:57:04 +00:00
|
|
|
rm --version
|
1997-08-31 22:15:57 +00:00
|
|
|
fi
|
|
|
|
|
|
2002-04-19 22:57:04 +00:00
|
|
|
pwd=`pwd`
|
|
|
|
|
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
|
|
|
|
|
trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
|
|
|
|
|
trap '(exit $?); exit' 1 2 13 15
|
1998-01-22 08:32:22 +00:00
|
|
|
|
2002-04-19 22:57:04 +00:00
|
|
|
framework_failure=0
|
|
|
|
|
mkdir -p $tmp || framework_failure=1
|
|
|
|
|
cd $tmp || framework_failure=1
|
1997-08-31 22:15:57 +00:00
|
|
|
|
2002-04-19 22:57:04 +00:00
|
|
|
if test $framework_failure = 1; then
|
2002-10-08 09:21:08 +00:00
|
|
|
echo "$0: failure in testing framework" 1>&2
|
2004-06-23 15:07:00 +00:00
|
|
|
(exit 1); exit 1
|
1997-08-31 22:15:57 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
fail=0
|
2002-04-19 22:57:04 +00:00
|
|
|
rm -r '' > /dev/null 2>&1 && fail=1
|
1997-08-31 22:15:57 +00:00
|
|
|
|
2004-06-23 15:07:00 +00:00
|
|
|
(exit $fail); exit $fail
|