#!/bin/sh
# call this from the directory which holds
# linux-$VERSION-orig and linux-$VERSION-fkt
# it will output patches to $PATCHDIR/linux-patch-$VERSION

[ -z "$VERSION" ] && VERSION=2.6.12-rc2
PATCHDIR=~/FxT/kernel
DIRORIG=linux-$VERSION-orig
DIRNEW=linux-$VERSION-fkt
rm $DIRNEW/include/asm -f
FILES=`diff -urq --exclude=SCCS --exclude=BitKeeper $DIRORIG $DIRNEW | grep -v "^Only in " | grep -v "^Seulement dans " | sed -e "s:^[^/]*/\([^ ]*\) .*$:\1:"`
echo $FILES
for i in $FILES
do
  mkdir -p $PATCHDIR/linux-patches-$VERSION/`dirname $i`
  diff -up $DIRORIG/$i $DIRNEW/$i > $PATCHDIR/linux-patches-$VERSION/$i.patch
done
