summaryrefslogtreecommitdiff
path: root/gendiff
blob: de51c5710d7b8e359c81d1b3af40ca85d658071d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

[ -z "$1" -o -z "$2" ] && {
# usage
  echo "usage: $0 <directory> <diff-extension>" 1>&2
  exit 1
}

find $1 \( -name "*$2" -o -name ".*$2" \) -print |
while read f; do
    U=-u
    [ "`basename $f`" = "ChangeLog$2" ] && U=-U0
#    diff ${U} $f `echo $f | sed s/$2\$//`
    if [ -r "$f" ]; then
	diff ${U} "${f}" "${f%$2}"
    else
	diff ${U} /dev/null "${f%$2}"
    fi
done