1*3a0ab0b7Sclaudio#! /bin/sh
2*3a0ab0b7Sclaudio
3*3a0ab0b7Sclaudio# testing modification time. This is tricky for two reasons:
4*3a0ab0b7Sclaudio# - BSD find only emits minutes granularity
5*3a0ab0b7Sclaudio# - the test might run less than a second, but the rsync
6*3a0ab0b7Sclaudio#   protocol has 1 second roundoff in times
7*3a0ab0b7Sclaudio# So we set some time older than this software for some
8*3a0ab0b7Sclaudio# parts of the original tree.
9*3a0ab0b7Sclaudio
10*3a0ab0b7Sclaudio. ${tstdir-.}/lib.sh
11*3a0ab0b7Sclaudio. ${tstdir-.}/conf.sh
12*3a0ab0b7Sclaudio
13*3a0ab0b7Sclaudiorm -rf dir1 dir2 dir3
14*3a0ab0b7Sclaudio# make the copy-from-here tree
15*3a0ab0b7Sclaudiomkdir dir1
16*3a0ab0b7Sclaudiocd dir1
17*3a0ab0b7Sclaudiotouch -d 1975-10-21T01:01:01 foo
18*3a0ab0b7Sclaudio# make the tree we want to compare to
19*3a0ab0b7Sclaudiomkdir ../dir2
20*3a0ab0b7Sclaudiocd ../dir2
21*3a0ab0b7Sclaudiotouch -d 1975-10-21T01:01:01 foo
22*3a0ab0b7Sclaudio
23*3a0ab0b7Sclaudio# test a - we want the time corrected
24*3a0ab0b7Sclaudiomkdir ../dir3
25*3a0ab0b7Sclaudiocd ../dir3
26*3a0ab0b7Sclaudiotouch -d 1975-10-21T01:01:01 foo
27*3a0ab0b7Sclaudio
28*3a0ab0b7Sclaudiocd ..
29*3a0ab0b7Sclaudio# call -a
30*3a0ab0b7Sclaudio$rsync -Dgorltp dir1/ dir3
31*3a0ab0b7Sclaudiocompare_trees dir2 dir3
32