Roland McGrath 11487c
#!/bin/sh
Roland McGrath 11487c
# Easy application of new patches.
Roland McGrath 11487c
# Always adds to the very end. (Bumps last patch nr by 100)
Roland McGrath 11487c
# Parameters:
Roland McGrath 11487c
# $1 - patch filename 
Roland McGrath 11487c
# $2 - description
Roland McGrath 11487c
Roland McGrath 11487c
OLD=$(grep ^Patch kernel.spec  | tail -n1 | awk '{ print $1 }' | sed s/Patch// | sed s/://)
Roland McGrath 11487c
NEW=$(($OLD/100*100+100))
Roland McGrath 11487c
Roland McGrath 11487c
sed -i "/^Patch$OLD:\ /a#\ $2\nPatch$NEW:\ $1" kernel.spec
Roland McGrath 11487c
Roland McGrath 11487c
LAST=$(grep ^ApplyPatch kernel.spec | tail -n1 | awk '{ print $2 }')
Roland McGrath 11487c
Roland McGrath 11487c
sed -i "/^ApplyPatch $LAST/aApplyPatch $1" kernel.spec
Roland McGrath 11487c
Roland McGrath 11487c
cvs add $1
Roland McGrath 11487c
Roland McGrath 11487c
scripts/bumpspecfile.py kernel.spec "- $2"
Roland McGrath 11487c
make clog
Roland McGrath 11487c