1998-05-11 11:46:48 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if test "$VERBOSE" = yes; then
|
|
|
|
set -x
|
1999-01-18 10:54:36 +08:00
|
|
|
cp --version
|
1998-05-11 11:46:48 +08:00
|
|
|
fi
|
|
|
|
|
2002-04-20 06:36:11 +08:00
|
|
|
. $srcdir/../lang-default
|
2002-10-09 16:09:57 +08:00
|
|
|
. $srcdir/../envvar-check
|
2002-04-20 06:36:11 +08: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-05-11 11:46:48 +08:00
|
|
|
framework_failure=0
|
2002-04-20 06:36:11 +08:00
|
|
|
mkdir -p $tmp || framework_failure=1
|
|
|
|
cd $tmp || framework_failure=1
|
|
|
|
|
1998-08-15 11:03:44 +08:00
|
|
|
echo a > a || framework_failure=1
|
|
|
|
echo a-tilde > a~ || framework_failure=1
|
1998-05-11 11:46:48 +08:00
|
|
|
|
|
|
|
if test $framework_failure = 1; then
|
2002-10-08 17:21:08 +08:00
|
|
|
echo "$0: failure in testing framework" 1>&2
|
2004-06-23 23:07:00 +08:00
|
|
|
(exit 1); exit 1
|
1998-05-11 11:46:48 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# This cp command should exit nonzero.
|
1999-10-16 22:44:17 +08:00
|
|
|
cp --b=simple a~ a > out 2>&1 && fail=1
|
1998-05-11 11:46:48 +08:00
|
|
|
|
1999-01-18 10:54:36 +08:00
|
|
|
sed "s,cp:,XXX:," out > out2
|
1998-05-11 11:46:48 +08:00
|
|
|
|
|
|
|
cat > exp <<\EOF
|
|
|
|
XXX: backing up `a' would destroy source; `a~' not copied
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cmp out2 exp || fail=1
|
|
|
|
|
2004-06-23 23:07:00 +08:00
|
|
|
(exit $fail); exit $fail
|