summaryrefslogtreecommitdiffstats
path: root/updatesums.sh
blob: 525fdf6e90aa2f09976ad596a31ee5e7dfb2a137 (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.sh: Update SHA-256 sums' miniprokit.sh