compare-dest.test 1012 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/sh
  2. # Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
  3. # This program is distributable under the terms of the GNU GPL (see
  4. # COPYING).
  5. # Test rsync handling of the --compare-dest option.
  6. . "$suitedir/rsync.fns"
  7. alt1dir="$tmpdir/alt1"
  8. alt2dir="$tmpdir/alt2"
  9. # Build some files/dirs/links to copy
  10. hands_setup
  11. # Setup the alt and chk dirs
  12. $RSYNC -av --include=text --include='*/' --exclude='*' "$fromdir/" "$alt1dir/"
  13. $RSYNC -av --include=etc-ltr-list --include='*/' --exclude='*' "$fromdir/" "$alt2dir/"
  14. sleep 1
  15. touch "$fromdir/dir/text"
  16. $RSYNC -av --exclude=/text --exclude=etc-ltr-list "$fromdir/" "$chkdir/"
  17. # Let's do it!
  18. checkit "$RSYNC -avv --no-whole-file \
  19. --compare-dest='$alt1dir' --compare-dest='$alt2dir' \
  20. '$fromdir/' '$todir/'" "$chkdir" "$todir"
  21. checkit "$RSYNC -avv --no-whole-file \
  22. --copy-dest='$alt1dir' --copy-dest='$alt2dir' \
  23. '$fromdir/' '$todir/'" "$fromdir" "$todir"
  24. # The script would have aborted on error, so getting here means we've won.
  25. exit 0