1998-03-05 00:05:15 +08:00
|
|
|
#!/bin/sh
|
1996-01-11 01:03:08 +08:00
|
|
|
|
1997-01-14 01:23:43 +08:00
|
|
|
[ -z "$1" -o -z "$2" ] && {
|
|
|
|
# usage
|
|
|
|
echo "usage: $0 <directory> <diff-extension>" 1>&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2007-05-16 22:59:15 +08:00
|
|
|
: ${DIFF:=diff}
|
|
|
|
: ${GENDIFF_DIFF_ARGS:=-up}
|
|
|
|
: ${GENDIFF_DIFF_CHANGELOG_ARGS:=-U0}
|
2007-04-16 19:42:56 +08:00
|
|
|
|
2008-02-09 03:58:26 +08:00
|
|
|
find $1 \( -name "*$2" -o -name ".*$2" \) -print | sort |
|
1996-01-11 01:03:08 +08:00
|
|
|
while read f; do
|
2007-05-16 22:59:15 +08:00
|
|
|
U="${GENDIFF_DIFF_ARGS}"
|
|
|
|
[ "`basename $f`" = "ChangeLog$2" ] && U="${GENDIFF_DIFF_CHANGELOG_ARGS}"
|
2007-05-17 18:06:55 +08:00
|
|
|
diffcmd="${DIFF} ${U} /dev/null ${f%$2}"
|
2007-04-16 19:42:56 +08:00
|
|
|
# ${DIFF} ${U} $f `echo $f | sed s/$2\$//`
|
2002-07-14 03:54:36 +08:00
|
|
|
if [ -r "$f" ]; then
|
2007-05-17 18:06:55 +08:00
|
|
|
diffcmd="${DIFF} ${U} ${f} ${f%$2}"
|
2002-07-14 03:54:36 +08:00
|
|
|
fi
|
2007-05-17 18:06:55 +08:00
|
|
|
echo "${diffcmd}"
|
|
|
|
${diffcmd}
|
1996-01-11 01:03:08 +08:00
|
|
|
done
|