Debian Codegraph @

tests/integration/tools/compare_dirs

raw
1 #!/bin/bash
2
3 lhs=$1
4 rhs=$2
5
6 lhs_files=$(cd $lhs; find . -type f -not -path *.git*)
7 rhs_files=$(cd $rhs; find . -type f -not -path *.git*)
8 echo $lhs_files
9 echo $rhs_files
10
11 if [[ $lhs_files != $rhs_files ]]; then
12 echo "folders do not have the same set of files";
13 exit 1;
14 fi
15
16 lhs_md5=$(cd $lhs; cat $lhs_files | md5)
17 rhs_md5=$(cd $rhs; cat $rhs_files | md5)
18
19 if [[ $lhs_md5 != $rhs_md5 ]]; then
20 echo "folders do not have the same content";
21 exit 1;
22 fi
23
24 exit 0;