2 # cp -R --parents dir-specified-with-trailing-slash/ other-dir
3 # would get a failed assertion.
5 if test "$VERBOSE" = yes; then
13 t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
14 trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $t0 && exit $status' 0
15 trap '(exit $?); exit' 1 2 13 15
19 # Record absolute path of srcdir and cd back to current dir.
20 cd $srcdir || framework_failure=1
22 cd $pwd || framework_failure=1
24 . $srcdir/../envvar-check
25 . $srcdir/../umask-check
27 mkdir -p $tmp || framework_failure=1
28 cd $tmp || framework_failure=1
30 . $abs_srcdir/../setgid-check
32 mkdir foo bar || framework_failure=1
33 mkdir -p a/b/c d e || framework_failure=1
35 if test $framework_failure = 1; then
36 echo 'failure in testing framework'
42 # With 4.0.37 and earlier (back to when?), this would fail
43 # with the failed assertion from dirname.c.
44 cp -R --parents foo/ bar || fail=1
46 # Exercise the make_path and re_protect code in cp.c.
47 # FIXME: compare verbose output with expected output.
48 cp --verbose -a --parents a/b/c d > /dev/null 2>&1 || fail=1
49 test -d d/a/b/c || fail=1
51 # Check that re_protect works.
53 cp -a --parents d/a/b/c e || fail=1
54 p=`ls -ld e/d|sed 's/ .*//'`; case $p in drwxr-xr-x);; *) fail=1;; esac
55 p=`ls -ld e/d/a|sed 's/ .*//'`; case $p in drwx-w--w-);; *) fail=1;; esac
56 p=`ls -ld e/d/a/b/c|sed 's/ .*//'`; case $p in drwxr-xr-x);; *) fail=1;; esac
58 (exit $fail); exit $fail