symlink-ignore.test 975 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/sh
  2. # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
  3. # This program is distributable under the terms of the GNU GPL (see
  4. # COPYING).
  5. # Test rsync's somewhat over-featured symlink control: the default
  6. # behaviour is that symlinks should not be copied at all.
  7. . "$suitedir/rsync.fns"
  8. build_symlinks || test_fail "failed to build symlinks"
  9. # Copy recursively, but without -l or -L or -a, and all the symlinks
  10. # should be missing.
  11. $RSYNC -r "$fromdir/" "$todir" || test_fail "$RSYNC returned $?"
  12. [ -f "$todir/referent" ] || test_fail "referent was not copied"
  13. [ -d "$todir/from" ] && test_fail "extra level of directories"
  14. if is_a_link "$todir/dangling"
  15. then
  16. test_fail "dangling symlink was copied"
  17. fi
  18. if is_a_link "$todir/relative"
  19. then
  20. test_fail "relative symlink was copied"
  21. fi
  22. if is_a_link "$todir/absolute"
  23. then
  24. test_fail "absolute symlink was copied"
  25. fi
  26. # The script would have aborted on error, so getting here means we've won.
  27. exit 0