2 # Compare the reference (make-ref-repo.sh) and replay (make-replay-repo.sh)
3 # repositories to check for any differences/problems with the svn2svn replay.
10 # Create a working-copy for the reference repo
11 # Note: We assume that the replay working-copy ("_dup_wc") still exists from make-replay-repo.sh
12 svn co
-q file://$PWD/_repo_ref
/trunk
$WCREF
14 # Check if the final list of files is the same
15 echo ">> Checking file-list..."
16 cd $WCREF && FILESREF
=$(find . -type f | grep -v "\.svn") && cd $PWD
17 cd $WCDUP && FILESDUP
=$(find . -type f | grep -v "\.svn") && cd $PWD
18 if [ "$FILESREF" != "$FILESDUP" ]; then
19 echo "$FILESREF" > _files_ref.txt
20 echo "$FILESDUP" > _files_replay.txt
21 echo "<<< _files_reference.txt"
22 echo ">>> _files_replay.txt"
23 diff _files_ref.txt _files_replay.txt
24 rm _files_ref.txt _files_replay.txt
29 # Check if the final file-contents is the same
30 echo ">> Checking file-contents..."
32 FILES
=$(find . -type f | grep -v "\.svn")
34 for file in $FILES; do
35 fname
=$(echo "$file" | sed 's/^\.\///')
36 FILEREF
="$WCREF/$fname"
37 FILEDUP
="$WCDUP/$fname"
38 if [ -f "$FILEDUP" ]; then
39 chksum1
=$(md5sum $FILEREF | cut -c1-32)
40 chksum2
=$(md5sum $FILEDUP | cut -c1-32)
41 if [ "$chksum1" != "$chksum2" ]; then
42 echo "Checksum mismatch: $fname"
43 echo " $chksum1 $FILEREF"
44 echo " $chksum2 $FILEDUP"
48 echo "No such file: $FILEDUP"
57 # If we found any differences, exit with an error-code
58 [ "$found_diff" -eq 1 ] && exit 1