summaryrefslogtreecommitdiff
path: root/alpine/update-patch
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-21 13:57:31 +0100
committerErich Eckner <git@eckner.net>2019-02-21 13:57:31 +0100
commit5ee1e0dd86329b4587c06a307984c28be82d8563 (patch)
tree88d8c36dddd5df5288113cae59eacf786c5887a7 /alpine/update-patch
parentc7daba79caa5271cb471430f98338b2f52d45fb2 (diff)
downloadarchlinuxewe-5ee1e0dd86329b4587c06a307984c28be82d8563.tar.xz
alpine: use patch instead of git cherry-pick
Diffstat (limited to 'alpine/update-patch')
-rwxr-xr-xalpine/update-patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/alpine/update-patch b/alpine/update-patch
new file mode 100755
index 000000000..c6df38d2c
--- /dev/null
+++ b/alpine/update-patch
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+cd "$(dirname "$0")"
+eval "$(
+ sed -n '
+ /^source=(/,/)/ p
+ ' PKGBUILD
+)"
+
+makepkg --verifysource
+git -C /usr/src/sonstiges/alpine/ fetch --all -p
+
+sums=$(
+ {
+ printf '%s\n' "${source[@]}" \
+ | sed '
+ s/\.patch$//
+ t
+ s/^.*$/SKIP/
+ w /dev/stderr
+ d
+ ' \
+ | while read -r patch; do
+ git -C /usr/src/sonstiges/alpine/ diff $(git -C /usr/src/sonstiges/alpine/ merge-base "${patch}" master) "${patch}" -- \
+ > "${patch}.patch"
+ sha512sum "${patch}.patch" | \
+ awk '{print $1}'
+ done
+ } 2>&1 \
+ | sed '
+ s/^/'"'"'/
+ s/$/'"'"'/
+ 1 s/^/sha512sums=(/
+ 1! s/^/ /
+ $ s/$/)/
+ ' \
+ | sed '
+ :a
+ N
+ $! ba
+ s/\n/\\n/g
+ '
+)
+
+sed -i '
+ /^sha512sums=(/,/^[^#]*)$/ {
+ s/^sha512sums=(.*$/'"${sums}"'/
+ t
+ d
+ }
+' PKGBUILD