db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / geoip-database / repos / extra-any / update.sh
blob6f380cb96ad2cce7b6cd7239d1bba54f2781b3b3
1 #!/bin/bash
3 set -eo pipefail
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'
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