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