summaryrefslogtreecommitdiffstats
path: root/updatesums.sh
blob: 0032447f97714b046cb633a6af1a394cd7e2da81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -eu

newsums="$(ssh files@files.proteanos.com sh -c \
	"\"sha256sum files/pub/proteanos/feeds/dev/trunk/*/*/*/Packages | sed \
	's| files/pub/proteanos/feeds/dev/trunk/||; s|/|_|g; s|_Packages||'\"")"

exec 3>miniprokit.sh~
sed -n '0,/^-- NEW SUMS --$/{ p; };' miniprokit.sh >&3
printf '%s\n' "${newsums}" >&3
sed -n '/^-- NEW SUMS --$/,/^-- OLD SUMS --$/{ /OLD/d; s/NEW/OLD/; p; };' \
	miniprokit.sh >&3
sed -n '/^-- END SUMS --$/,${ p; };' miniprokit.sh >&3
exec 3>&-

cat miniprokit.sh~ >miniprokit.sh
rm miniprokit.sh~

git commit -m 'miniprokit: Update SHA-256 sums' miniprokit.sh