summaryrefslogtreecommitdiffstats
path: root/diffscript
blob: c35beb90540b0e26b0f63d055512cff1cab7d29d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# diffscript
#
# This script is used to compare the contents of repository directory trees.
# It is used by the Testcimmof Makefile which builds one copy of the repository
# with cimmofl and another with cimmof.  The two repositories are expected to
# have the same contents.
#
# Usage:  diffscript repository-dir repository-subdir
#
# The repository-dir argument is the directory containing the two repositories
# to compare.  They are expected to be named "repository" and "repository.old".
# the repository-subdir is a specific subdirectory to compare within the
# repositories.  The net effect is a comparison of these two directories:
#
#     <repository-dir>/repository/<repository-subdir>
#     <repository-dir>/repository.old/<repository-subdir>

echo "Comparing Repository files..."
cd $1/repository/$2
rm -f repository.log
retCode=0
for i in `find ./ -type f`
do
    echo "Comparing " $i >> repository.log
    diff $i ../../../repository.old/$2/$i >> repository.log
    if [ $? -eq 1 ] ;then
        retCode=1
        echo "Files are different" >> repository.log
    fi
done
if [ retCode -eq 1 ] ;then
    echo +++ Test failed +++
else
    echo +++ Test passed +++
fi