summarylogtreecommitdiffstats
path: root/post-update.sh
diff options
context:
space:
mode:
authorJohannes Wienke2021-10-02 16:53:40 +0200
committerJohannes Wienke2021-10-02 16:53:54 +0200
commite310320985606306592e36a5eacc771b777ace32 (patch)
tree8a79aaad3e002efb347caa129abdab6c221ff2ba /post-update.sh
parentb25cb488750102affa704f7740a812d11be88a31 (diff)
downloadaur-e310320985606306592e36a5eacc771b777ace32.tar.gz
ci: add a renovate config
Diffstat (limited to 'post-update.sh')
-rwxr-xr-xpost-update.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/post-update.sh b/post-update.sh
new file mode 100755
index 000000000000..c2516ee42c40
--- /dev/null
+++ b/post-update.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -exuo pipefail
+
+uid="$(id -u)"
+
+# Move pkgrel back to 1 after a version bump
+sed -i 's/pkgrel=.*/pkgrel=1/' ./PKGBUILD
+
+# Update checksums and the .SRCINFO file to match the new version.
+# The easiest and most consistent way to do this is by using the
+# archlinux-provided tools for this. Because renovate doesn't run in an arch
+# container, use docker to spin up a temporary container for this purpose.
+# makepkg in this container cannot be run as root. Therefore, create a
+# temporary user for this. This used need to use the UID of the host's user to
+# avoid file access problems when using bind mounts in docker.
+docker run --rm -v "$(pwd):/pkg" archlinux:latest bash -c "
+set -exuo pipefail
+pacman -Syu --noconfirm pacman-contrib binutils
+useradd -u ${uid} builder
+cd /pkg
+su builder -c updpkgsums
+su builder -c 'makepkg --printsrcinfo > .SRCINFO'
+"