summaryrefslogtreecommitdiffstats
path: root/scripts/newpatch.sh
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-07-29 19:24:43 -0700
committerRoland McGrath <roland@redhat.com>2010-07-29 19:24:43 -0700
commit11487c5358c414c73bcfd9c850d469fba081f18c (patch)
tree37772c24c3e6aea1f9afc12f2ff89c9ae58e15cc /scripts/newpatch.sh
parent7f2b706ac8d669475df57714364a00361ae3072f (diff)
downloadkernel-11487c5358c414c73bcfd9c850d469fba081f18c.tar.gz
kernel-11487c5358c414c73bcfd9c850d469fba081f18c.tar.xz
kernel-11487c5358c414c73bcfd9c850d469fba081f18c.zip
Restore README.txt, scripts.
Diffstat (limited to 'scripts/newpatch.sh')
-rwxr-xr-xscripts/newpatch.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/newpatch.sh b/scripts/newpatch.sh
new file mode 100755
index 000000000..0dc2e837c
--- /dev/null
+++ b/scripts/newpatch.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Easy application of new patches.
+# Always adds to the very end. (Bumps last patch nr by 100)
+# Parameters:
+# $1 - patch filename
+# $2 - description
+
+OLD=$(grep ^Patch kernel.spec | tail -n1 | awk '{ print $1 }' | sed s/Patch// | sed s/://)
+NEW=$(($OLD/100*100+100))
+
+sed -i "/^Patch$OLD:\ /a#\ $2\nPatch$NEW:\ $1" kernel.spec
+
+LAST=$(grep ^ApplyPatch kernel.spec | tail -n1 | awk '{ print $2 }')
+
+sed -i "/^ApplyPatch $LAST/aApplyPatch $1" kernel.spec
+
+cvs add $1
+
+scripts/bumpspecfile.py kernel.spec "- $2"
+make clog
+