diff options
author | Erich Eckner <git@eckner.net> | 2019-01-10 11:48:37 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-10 11:48:37 +0100 |
commit | aa05459a1b4789d3f9a7f78895a4af597294e350 (patch) | |
tree | 26d37790760616f39dd04b90f940f47e711e4109 | |
parent | c6ce0195cb5ea8bcb092190e3e45fb42fad6cf33 (diff) | |
download | archlinuxewe-aa05459a1b4789d3f9a7f78895a4af597294e350.tar.xz |
openttd-git/update-patches: update checksum of patches, too
-rwxr-xr-x | openttd-git/update-patches | 45 |
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 |