sbcl rebuild
[arch-packages.git] / geoip-database / trunk / update.sh
blob578db52c46788cfec30b0419641256ccf7d23c25
1 #!/bin/bash
3 set -eo pipefail
5 readonly upstream=https://mailfud.org/geoip-legacy/
7 version=$(curl -s "$upstream/build.log" | grep -Po 'CSV_\K[0-9]{8}' |
8 sort -n | tail -1)
10 if [[ ${#version} != 8 ]]; then
11 echo >&2 'Unable to determine upstream database version'
12 exit 1
15 pkgver=$(. PKGBUILD; echo $pkgver)
17 if ((pkgver >= version)); then
18 echo >&2 "Already at version $pkgver (>= $version upstream)"
19 exit 1
22 ssh -T sources.archlinux.org <<-EOF
23 mkdir -p /srv/sources/other/packages/geoip-database/$version &&
24 cd /srv/sources/other/packages/geoip-database/$version &&
25 curl --remote-name-all $upstream/GeoIP{,City,ASNum}{,v6}.dat.gz
26 EOF
28 sed -i -e "/^pkgver=/c pkgver=$version" -e "/^pkgrel=/c pkgrel=1" PKGBUILD