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