@@ 5,6 5,7 @@ release=$1
buildfile=PKGBUILD
sumtext=sha256sum.txt.asc
url="https://github.com/syncthing/syncthing/releases/download/v${release}/${sumtext}"
+blob="https://github.com/syncthing/syncthing/archive/refs/tags/v${release}.tar.gz"
# check there is a sums file for this release
curl -LO "$url"
@@ 13,10 14,15 @@ if [[ $(head -n 1 "$sumtext") =~ "Not Fo
exit 1
fi
+# grab binary
+curl -LO "$blob"
+sha256sum "${blob##*/}" >> "$sumtext"
+
# update package version & provides
sed -i -e "s:pkgver=[0-9].*:pkgver=${release}:
s:provides=('syncthing=[0-9].*'):provides=('syncthing=${release}'):
- /^sha256sums/a#individual sums" "$buildfile"
+ /^source_i686/a#individual sums
+ /^package()/i#package\n" "$buildfile"
newsums=$( awk '
{
@@ 33,22 39,26 @@ newsums=$( awk '
case /linux-amd64/:
x86 = $1
break
- }
- }
+ case /^v*/:
+ sums = $1
+ break
+ }
+}
END {
- printf "sha256sums_x86_64=(\047%s\047)\n"\
- "sha256sums_aarch64=(\047%s\047)\n"\
- "sha256sums_armv7h=(\047%s\047)\n"\
- "sha256sums_i686=(\047%s\047)",
- x86, arm64, arm, i386
+ printf "sha256sums=(\047%s\047)\n"\
+ "sha256sums_x86_64=(\047%s\047)\n"\
+ "sha256sums_aarch64=(\047%s\047)\n"\
+ "sha256sums_armv7h=(\047%s\047)\n"\
+ "sha256sums_i686=(\047%s\047)",
+ sums, x86, arm64, arm, i386
}' $sumtext)
-(( $? == 0 )) && rm "$sumtext"
+(( $? == 0 )) && rm "$sumtext" "${blob##*/}"
{
rm "$buildfile"
exec awk -v newsums="$newsums" '
- /^#individual/ {
+ /^#individual/,/^#package/ {
if (!w) { print newsums; w++ }
next
}; 1