5 readonly upstream
=https
://mailfud.org
/geoip-legacy
7 lastmod
=$
(curl
-sI "$upstream/GeoIP.dat.gz" |
grep -i last-modified | cut
-d: -f2)
8 version
=$
(date -d "$lastmod" +%Y
%m
%d
)
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