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:
authorErich Eckner <git@eckner.net>2018-02-02 14:42:49 +0100
committerErich Eckner <git@eckner.net>2018-02-02 14:42:49 +0100
commitb51ce612126c7193a34a52f80a124de51f06dc79 (patch)
tree7e9b533ece2c692cdb41c8243f1ab043c62704d6 /update-kernel-config
parent25b2d7dd8acdcc9356cf4179ab12c1f1c911a19c (diff)
update-kernel-config new
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"