*** empty log message ***
[coreutils.git] / tests / mv / backup-is-src
blob7f1e623266e55a06c4dd34ac69bd19dc70300579
1 #!/bin/sh
2 # Force mv to use the copying code.
4 if test "$VERBOSE" = yes; then
5 set -x
6 mv --version
7 fi
9 . $srcdir/setup
11 if test -z "$other_partition_tmpdir"; then
12 exit 77
15 a="$other_partition_tmpdir/a"
16 a2="$other_partition_tmpdir/a~"
18 framework_failure=0
19 rm -f $a $a2 || framework_failure=1
20 echo a > $a || framework_failure=1
21 echo a2 > $a2 || framework_failure=1
23 if test $framework_failure = 1; then
24 echo 'failure in testing framework'
25 exit 1
28 # Make sure we get English translations.
29 . $srcdir/../lang-default
31 # This mv command should exit nonzero.
32 mv --b=simple $a2 $a > out 2>&1 && fail=1
34 sed \
35 -e "s,mv:,XXX:," \
36 -e "s,$a,YYY," \
37 -e "s,$a2,ZZZ," \
38 out > out2
40 cat > exp <<\EOF
41 XXX: backing up `YYY' would destroy source; `ZZZ' not moved
42 EOF
44 cmp out2 exp || fail=1
46 rm -fr out out2 exp $a $a2 $other_partition_tmpdir
48 exit $fail