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 37 38 39 40 41 42 43 44
|
#! /bin/sh
#================================================================
# diffcheck
# List files different from ones of another version
#================================================================
# set variables
progexts='\.in|\.h|\.c|\.cc|\.cpp|\.cxx|\.java|\.pl|\.pm|\.pod|\.rb|\.rd'
docexts='\.[1-9]|spex\.html|\spex-ja\.html|\.txt'
regex="($progexts|$docexts)\$"
# check arguments
if [ $# != 1 ]
then
printf 'diffcheck: usage: diffcheck directory_of_oldversion\n' 1>&2
exit 1
fi
# diff files
find . -type f | egrep $regex |
while read file
do
old=`printf '%s\n' "$file" | sed 's/^\.\///'`
printf 'Checking %s and %s ... ' "$file" "$1/$old"
res=`diff -q "$file" "$1/$old"`
if [ -z "$res" ]
then
printf 'same\n'
else
printf '### !!! DIFFERENT !!! ###\n'
fi
done
# exit normally
exit 0
# END OF FILE
|