Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/update-kernel-config
diff options
context:
space:
mode:
Diffstat (limited to 'update-kernel-config')
-rwxr-xr-xupdate-kernel-config30
1 files changed, 30 insertions, 0 deletions
diff --git a/update-kernel-config b/update-kernel-config
new file mode 100755
index 0000000..df52d67
--- /dev/null
+++ b/update-kernel-config
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+if [ $# -ne 3 ]; then
+ >&2 echo 'usage: update-kernel-config [repository] [kernel-name] [old-git-revision]'
+ exit 2
+fi
+
+diff=$(
+ git -C "/usr/src/archlinux/packages/$2/repos/$1-x86_64" diff "$3" -- config | \
+ grep '^[+-]' | \
+ grep -v '^+++\|^---'
+)
+
+{
+ grep -vxF "$(
+ printf '%s\n' "${diff}" | \
+ sed -n '
+ s/^-//
+ T
+ p
+ '
+ )" "/usr/src/github/archlinux32/packages/$1/$2/config-i686"
+ printf '%s\n' "${diff}" | \
+ sed -n '
+ s/^+//
+ T
+ p
+ '
+} | \
+ sponge "/usr/src/github/archlinux32/packages/$1/$2/config-i686"