summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-10 11:48:37 +0100
committerErich Eckner <git@eckner.net>2019-01-10 11:48:37 +0100
commitaa05459a1b4789d3f9a7f78895a4af597294e350 (patch)
tree26d37790760616f39dd04b90f940f47e711e4109
parentc6ce0195cb5ea8bcb092190e3e45fb42fad6cf33 (diff)
downloadarchlinuxewe-aa05459a1b4789d3f9a7f78895a4af597294e350.tar.xz
openttd-git/update-patches: update checksum of patches, too
-rwxr-xr-xopenttd-git/update-patches45
1 files changed, 37 insertions, 8 deletions
diff --git a/openttd-git/update-patches b/openttd-git/update-patches
index 02811856f..231af4d7c 100755
--- a/openttd-git/update-patches
+++ b/openttd-git/update-patches
@@ -10,13 +10,42 @@ eval "$(
git -C openttd-git fetch local
git -C openttd-git fetch --all -p
-printf '%s\n' "${source[@]}" \
- | sed '
- s/\.patch$//
+sums=$(
+ {
+ printf '%s\n' "${source[@]}" \
+ | sed '
+ s/\.patch$//
+ t
+ s/^.*$/SKIP/
+ w /dev/stderr
+ d
+ ' \
+ | while read -r patch; do
+ git -C openttd-git diff master "remotes/local/${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
- ' \
- | while read -r patch; do
- git -C openttd-git diff master "remotes/local/${patch}" -- \
- > "${patch}.patch"
- done
+ }
+' PKGBUILD