From aa05459a1b4789d3f9a7f78895a4af597294e350 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 10 Jan 2019 11:48:37 +0100 Subject: openttd-git/update-patches: update checksum of patches, too --- openttd-git/update-patches | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file 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 -- cgit v1.2.3-70-g09d2