difforig originally came from the postgresql hackers, but I enhanced it to easier submit simple multifile patches in
#!/bin/sh
echo "difforig $@"
echo ""
/usr/bin/date +"%Y-%m-%d Reini Urban <rurban@x-ray.at>"
echo ""
if [ "$#" -gt 1 -o -f "$1" ] # multiple args or a file
then
for FILE in "$@"
do
ORIG="$FILE.orig"
echo "$FILE" 1>&2
echo "diff -ub $ORIG $FILE"
/usr/bin/diff -ub $ORIG $FILE
done
else
if [ "$#" -eq 0 ]
then APATH="." # no arg: recursively all origs
else APATH="$1" # or one arg: recursively all origs
fi
find "$APATH" -name '*.orig' -print | sort \
while read FILE
do
NEW="`dirname $FILE`/`basename $FILE.orig`"
echo "$NEW" 1>&2
echo "diff -ub $ORIG $FILE"
/usr/bin/diff -ub $FILE $NEW
done
fi
Some useful ~/bin scripts: difforig 0 Comments More | Login | Reply /