If you have only modified a couple of files, I find it easier to use 'gendiff' which comes with rpm:
Code: Select all
#!/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
gendiff . .00 > name-of-patch
Sometimes I go through both trees of sources and remove files from both which are showing up in the diff but which are not pertinent to the changes -like Makefile.in autogen.sh, etc. This case is a typical example of comparing incomplete autoconf sources(from CVS or other -hence the autogen.sh) against sources which have already had their conf files regenerated and then edited as well.
You can also manually cut and remove the sections of the diff which don't matter. If you can't figure it out, attach the big diff and I'll cut it down to size for you. I've gotten pretty handy at it after a few hundred times of dissecting debian patches which typically run in the 250-300 thousand lines (exactly because they always include 'debianized' config.guess, config.sub and all the Makefile.in files which are not often essential to the source code changes).
A few runs of this sort (run in both trees) can help a lot:
find -name Makefile.in -exe rm -f {} \;
find -name "*~" -exe rm -f {} \;
find -name CVS -exe rm -rf {} \;