2 # Make sure that cp -dR dereferences a symlink arg if its name is
3 # written with a trailing slash.
5 if test "$VERBOSE" = yes; then
10 . $srcdir/../envvar-check
11 . $srcdir/../lang-default
14 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
15 trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
16 trap '(exit $?); exit' 1 2 13 15
19 mkdir -p $tmp || framework_failure=1
20 cd $tmp || framework_failure=1
22 mkdir dir || framework_failure=1
23 ln -s dir symlink || framework_failure=1
25 if test $framework_failure = 1; then
26 echo 'failure in testing framework'
31 cp -dR symlink/ s || fail=1
34 # Prior to fileutils-4.0q, the following would have output ...`s -> dir'
35 # because the trailing slash was removed unconditionally (now you have to
36 # use the new --strip-trailing-slash option) causing cp to reproduce the
37 # symlink. Now, the trailing slash is interpreted by the stat library
38 # call and so cp ends up dereferencing the symlink and copying the directory.
39 test "$*" = 'total 0' && : || fail=1
41 (exit $fail); exit $fail