summarylogtreecommitdiffstats
path: root/update.sh
blob: ff06d3a833f9e1c922510dcfd4b5177c20756208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -euo pipefail

cd "$(dirname "$0")"

CHROMIUM_VERSION=$(curl -sSf "https://omahaproxy.appspot.com/linux")
V8_VERSION=$(curl -sSf "https://omahaproxy.appspot.com/v8.json?version=$CHROMIUM_VERSION" | jq -r '.v8_version')

sed -i -e "s/^pkgver=.*/pkgver=$V8_VERSION/" -e 's/pkgrel=.*/pkgrel=1/' PKGBUILD
if (git diff --quiet PKGBUILD); then
	echo "Nothing to do"
	exit
fi

echo "Updating to $V8_VERSION..."
makepkg --printsrcinfo > .SRCINFO
git restore --staged .
git add PKGBUILD .SRCINFO
git commit -m "Update to $V8_VERSION"