File: diffcheck

package info (click to toggle)
qdbm 1.8.78-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,076 kB
  • sloc: ansic: 31,454; cpp: 3,623; perl: 2,167; java: 2,079; ruby: 1,690; makefile: 1,315; javascript: 627; sh: 396
file content (44 lines) | stat: -rwxr-xr-x 850 bytes parent folder | download | duplicates (11)
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