aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Slaney2024-10-23 11:38:21 -0700
committerKent Slaney2024-10-23 11:38:21 -0700
commit531497a9b52ac311a999df2b03c01cf22e88fd8f (patch)
treede5e759e6ccdf755450e67ebdcacf532e3341274
parent6a761b9904a9488172e786b551d6cbab8f5a2847 (diff)
downloadaur-531497a9b52ac311a999df2b03c01cf22e88fd8f.tar.gz
fixes src checksum in update script
-rw-r--r--update.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/update.sh b/update.sh
index ec0971071854..acfd4296ec5d 100644
--- a/update.sh
+++ b/update.sh
@@ -1,19 +1,24 @@
api="https://api.github.com/repos/bakkesmodorg/BakkesModInjectorCpp/releases/latest"
dll="https://github.com/bakkesmodorg/BakkesModInjectorCpp/releases/latest/download/BakkesMod.zip"
-src="https://api.github.com/repos/bakkesmodorg/BakkesModInjectorCpp/zipball/master"
loopback="https://github.com/kentslaney/bakkesmod-arch.git"
+
cd `mktemp -d`
curl -LO "$api"
+rlstr=`jq -r .tag_name latest`
+src="https://github.com/bakkesmodorg/BakkesModInjectorCpp/archive/refs/tags/$rlstr.zip"
+
curl -LO "$dll"
curl -LO "$src"
git clone "$loopback"
-rlstr=`jq -r .tag_name latest`
+
rlver=`echo "$rlstr" | sed "s%\.% %g"`
pkgver=`echo "$rlstr" | sed "s%\..*\.%.%g"`
dll_sum=`sha256sum BakkesMod.zip | sed "s% *[^ ]*$%%"`
-src_sum=`sha256sum master | sed "s% *[^ ]*$%%"`
+src_sum=`sha256sum "$rlstr.zip" | sed "s% *[^ ]*$%%"`
+
cd bakkesmod-arch
git checkout "${1:-master}"
+git remote set-url origin git@github.com:kentslaney/bakkesmod-arch.git
eval `grep -Pzo "source=\([^)]*\)" PKGBUILD | xargs --null echo`
start=`grep -n "sha256sums=" PKGBUILD | cut -d':' -f1`
for i in $(seq 0 "${#source[@]}"); do
@@ -23,6 +28,7 @@ for i in $(seq 0 "${#source[@]}"); do
src_idx=$((start + i + 1))
fi
done
+
sed -i "${dll_idx}s/\( *\)'[^']*'/\1'$dll_sum'/" PKGBUILD
sed -i "${src_idx}s/\( *\)'[^']*'/\1'$src_sum'/" PKGBUILD
sed -i "s/rlver=( .* )/rlver=( $rlver )/" PKGBUILD