#! /bin/bash

OLD=orsa
NEW=orsa.0

[ "$1" ] && OLD=$1
[ "$2" ] && NEW=$2
[ ! -d "$OLD" ] && echo "Directory '$OLD' doesn't exist" >&2 && exit
[ ! -d "$NEW" ] && echo "Directory '$NEW' doesn't exist" >&2 && exit

list=`mktemp`
fw_list=`mktemp`
diffopt="-ruN --exclude-from=$list"

# do not try to diff the files below
cat >> $list <<EOF
*~
*.mak
*.log
*.pro
*.nsi
*.kdevses
*.Po
*.Plo
_win32
_tmp
log
CVS
Doxyfile
Makefile
Makefile.in
autom4te.cache
aclocal.m4
stamp-h1
config.h.in
config.guess
config.status
config.sub
configure
depcomp
missing
libtool
mkinstalldirs
install-sh
ltmain.sh
config.h
EOF

p=$NEW.patch
rm -f $p
for n in .; do
	diff $diffopt $OLD/$n $NEW/$n >> $p
done

rm -f $list $fw_list

