diff options
author | slurpee | 2022-06-24 22:34:18 -0700 |
---|---|---|
committer | slurpee | 2022-06-24 22:47:09 -0700 |
commit | 25c92d77d8e3ffb01e4f5d684a3e56069d208eff (patch) | |
tree | 1d9ea2526de81748ab355445e9a372e12653d1be | |
parent | 1c6ca23775dfa513b585646fcd757f1c599ebefe (diff) | |
download | aur-25c92d77d8e3ffb01e4f5d684a3e56069d208eff.tar.gz |
add package update helper script
Adds the helper script that I use to automate generating the sha256sums
as 1password doesn't publish the checksums separately. It downloads the
archives, verifies the signature of the binary with 1password's public
GPG key and if the signature is good, updates the hash in the PKGBUILD.
Invoked with the PKGBUILD env variable:
PKGVER=2.5.1 ./package-update.sh
-rw-r--r-- | package-update.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/package-update.sh b/package-update.sh new file mode 100644 index 000000000000..1e0150387018 --- /dev/null +++ b/package-update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +arch=( 'x86_64' 'i686' 'arm' 'aarch64' ) +_arch=( 'amd64' '386' 'arm' 'arm64' ) + +sed -i "s/pkgver=.*/pkgver=${PKGVER}/" PKGBUILD + +for a in "${!arch[@]}"; do + wget -q https://cache.agilebits.com/dist/1P/op2/pkg/v"${PKGVER}"/op_linux_"${_arch[a]}"_v"${PKGVER}".zip + unzip -q op_linux_"${_arch[a]}"_v"${PKGVER}".zip + if gpgv -q op.sig op > /dev/null 2>&1; then + sha256=$(sha256sum op_linux_"${_arch[a]}"_v"${PKGVER}".zip | awk '{print $1}') + sed -i "s/sha256sums_${arch[a]}=.*/sha256sums_${arch[a]}=\('${sha256}'\)/" PKGBUILD + else + echo "Bad Signature for op_linux_${arch[a]}_v${PKGVER}.zip." + fi + rm op* +done |