5 readonly upstream
=https
://mailfud.org
/geoip-legacy
/
7 version
=$
(curl
-s "$upstream/build.log" |
grep -Po 'CSV_\K[0-9]{8}' |
10 if [[ ${#version} != 8 ]]; then
11 echo >&2 'Unable to determine upstream database version'
15 pkgver
=$
(. PKGBUILD
; echo $pkgver)
17 if ((pkgver
>= version
)); then
18 echo >&2 "Already at version $pkgver (>= $version upstream)"
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
28 sed -i -e "/^pkgver=/c pkgver=$version" -e "/^pkgrel=/c pkgrel=1" PKGBUILD