#!/bin/bash # $1: Original code # $2: New code # $3: Kernel version # $4: Name of the patch file # $5: Location for the patch on the website usage(){ cat< EOF exit } if [ "%$1%" = "%%" ] then usage fi if [ "%$2%" = "%%" ] then usage fi if [ "%$3%" = "%%" ] then usage fi if [ "%$4%" = "%%" ] then usage fi #if [ "%$5%" = "%%" ] #then # usage #fi cd $1 > /dev/null rm TAGS > /dev/null make clean > /dev/null make mrproper > /dev/null cd /usr/src > /dev/null find $1 -type f -name "*~" -exec rm {} \; > /dev/null find $1 -type f -name "#*#" -exec rm {} \; > /dev/null find $1 -type f -name "*.rej" -exec rm {} \; > /dev/null cd $2 > /dev/null rm TAGS > /dev/null make clean > /dev/null make mrproper > /dev/null cd /usr/src > /dev/null find $2 -type f -name "*~" -exec rm {} \; > /dev/null find $2 -type f -name "#*#" -exec rm {} \; > /dev/null find $2 -type f -name "*.rej" -exec rm {} \; > /dev/null #mkdir -p /home/httpd/html/linux/$5/$3 #diff -Nur $1 $2 > /home/httpd/html/linux/$5/$3/$4 diff -Nur $1 $2 > $4 #less /home/httpd/html/linux/$5/$3/$4 less $4 echo -n "Is this patch ready? (y/n): " read ready if [ "%$ready%" == "%y%" ] then # echo "Ready" > /home/httpd/html/linux/$5/$3/$4-state echo "Ready" > $4-state echo "Marked ready" fi