From 1ce33d160426858348cea27ebfc8383cb7752344 Mon Sep 17 00:00:00 2001 From: Thiago Almeida Date: Sat, 10 Oct 2020 10:24:01 +0200 Subject: Adding a simple script to automate update process --- update.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 update.sh (limited to 'update.sh') diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..7d0e08b --- /dev/null +++ b/update.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -eou pipefail + +GITHUB_TOKEN=${GITHUB_TOKEN} + +http https://api.github.com/repos/claudiodangelis/qrcp/releases/latest \ + "Accept: application/vnd.github.v3+json" \ + "Authorization: ${GITHUB_TOKEN}" | + jq -r '.assets[] | select(.name | test("^(checksums.txt|qrcp.*_linux_(x86_64|i386).tar.gz)$")) | .browser_download_url' | + xargs -n 1 -P 3 wget + +sha256sum --ignore-missing --status -c checksums.txt + +I386_SHA=$(awk '/qrcp.*_linux_i386.tar.gz$/ {print $1}' checksums.txt) + +X86_64_SHA=$(awk '/qrcp.*_linux_x86_64.tar.gz$/ {print $1}' checksums.txt) + +sed -i 's/\(sha256sums_x86_64=\)(\d*)/\1'"$X86_64_SHA"'/g' PKGBUILD + +sed -i 's/\(sha256sums_i386=\)(\d*)/\1'"$I386_SHA"'/g' PKGBUILD + +makepkg --printsrcinfo >.SRCINFO -- cgit v1.2.3-70-g09d2