1#! /bin/sh
2
3# Testing that rsync -a without -p indeed leaves permissions alone.
4# Make the target tree and mess up some permissions in there.
5# We expect rsync to NOT reset this to what dir1 has since we don't
6# use -a.
7
8. ${tstdir-.}/lib.sh
9. ${tstdir-.}/conf.sh
10
11rm -rf dir1 dir2 dir3
12# make the copy-from-here tree
13mkdir dir1
14cd dir1
15generate_tree_1
16# make the tree we want to compare to
17mkdir ../dir2
18cd ../dir2
19generate_tree_1
20chmod 600 foo/bar/baz/one.txt
21touch -m -t 199901020405 foo/bar/baz/one.txt
22chmod 777 foo/bar/baz/one2.txt
23touch -m -t 199901020405 foo/bar/baz/one2.txt
24
25mkdir ../dir3
26cd ../dir3
27generate_tree_1
28chmod 600 foo/bar/baz/one.txt
29touch -m -t 199901020405 foo/bar/baz/one.txt
30chmod 777 foo/bar/baz/one2.txt
31touch -m -t 199901020405 foo/bar/baz/one2.txt
32
33cd ..
34# call -a without -p.
35$rsync -Dglort dir1/ dir3
36compare_trees dir2 dir3
37