[packages/GeoIP-db-Country] version: use newest datafile (ipv4/ipv6)

glen glen at pld-linux.org
Mon Mar 3 13:00:09 CET 2014


commit e615bf0339c3caab36d5c4526e9e89a7085b500f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Mar 3 14:00:04 2014 +0200

    version: use newest datafile (ipv4/ipv6)

 GeoIP-db-Country.spec | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/GeoIP-db-Country.spec b/GeoIP-db-Country.spec
index 7ceb3b5..be3931f 100644
--- a/GeoIP-db-Country.spec
+++ b/GeoIP-db-Country.spec
@@ -36,10 +36,14 @@ przez MaxWind, dostępne z <http://www.maxwind.com/>.
 cp -p %{SOURCE0} .
 cp -p %{SOURCE1} .
 
-gunzip GeoIP-%{version}.dat.gz
-gunzip GeoIPv6-%{version}.dat.gz
-
-ver=$(TZ=GMT stat -c '%y' GeoIP-%{version}.dat | awk '{print $1}' | tr - .)
+gzip -d GeoIP-%{version}.dat.gz GeoIPv6-%{version}.dat.gz
+dt4=$(TZ=GMT stat -c '%y' GeoIP-%{version}.dat | awk '{print $1}' | tr - .)
+dt5=$(TZ=GMT stat -c '%y' GeoIP-%{version}.dat | awk '{print $1}' | tr - .)
+if [ "$(echo $dt4 | tr -d .)" -gt "$(echo $dt6 | tr -d .)" ]; then
+	ver=$dt4
+else
+	ver=$dt6
+fi
 if [ "$ver" != %{version} ]; then
 	exit 1
 fi
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/GeoIP-db-Country.git/commitdiff/e615bf0339c3caab36d5c4526e9e89a7085b500f



More information about the pld-cvs-commit mailing list