summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Santalla2022-04-21 17:46:00 +0200
committerRoberto Santalla2022-04-21 17:46:00 +0200
commit5bd0c537ccb160d6a673367ea7e5d6634d8e870b (patch)
tree9daf876daed8f2227851e835d679b109c555fb01
parent18bdb31dcb2532bb221cbb9b7d95a0048241f3c2 (diff)
downloadaur-5bd0c537ccb160d6a673367ea7e5d6634d8e870b.tar.gz
add update.sh helper script
-rwxr-xr-xupdate.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..605f82e1b056
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -e
+
+UPSTREAM=${UPSTREAM:-newrelic/infrastructure-agent}
+echo "Using ${UPSTREAM} as upstream repo"
+
+if [[ -z $VERSION ]]; then
+ VERSION=$(curl -s https://api.github.com/repos/newrelic/infrastructure-agent/releases/latest | jq -r .tag_name)
+fi
+
+echo "Updating PKGBUILD to ${VERSION}"
+sed -i "s/pkgver=.*/pkgver=${VERSION}/" PKGBUILD
+
+echo "Updating checksums..."
+updpkgsums
+
+echo "Checking build..."
+makepkg -s
+
+echo "Updating .SRCINFO..."
+makepkg --printsrcinfo > .SRCINFO
+
+echo "Successfully updated PKGBUILD to $VERSION"