[packages/GeoIP-db-City] use newest file date as package version
glen
glen at pld-linux.org
Mon Jul 27 12:31:50 CEST 2015
commit 1f67771b5020f8391b37e9ed4723a123a046b4f4
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Jul 27 13:31:40 2015 +0300
use newest file date as package version
GeoIP-db-City.spec | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/GeoIP-db-City.spec b/GeoIP-db-City.spec
index 445057b..760d582 100644
--- a/GeoIP-db-City.spec
+++ b/GeoIP-db-City.spec
@@ -3,7 +3,7 @@ Summary(pl.UTF-8): GeoLite City - baza danych miast dla GeoIP
Name: GeoIP-db-City
# Updated every month:
Version: 2015.07.24
-Release: 1
+Release: 2
License: CC 3.0 BY-SA
Group: Applications/Databases
Source0: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.xz?/GeoLiteCity-%{version}.dat.xz
@@ -40,7 +40,22 @@ cp -p %{SOURCE1} .
xz -d GeoLiteCity-%{version}.dat.xz
gunzip GeoLiteCityv6-%{version}.dat.gz
-ver=$(TZ=GMT stat -c '%y' GeoLiteCity-%{version}.dat | awk '{print $1}' | tr - .)
+%build
+# get file DATE in GMT timezone
+filedate() {
+ TZ=GMT stat -c '%y' "$1" | awk '{print $1}'
+}
+
+# use newest file date as version
+d1=$(filedate GeoLiteCity-%{version}.dat)
+d2=$(filedate GeoLiteCityv6-%{version}.dat)
+if [ "$(echo $d1 | tr -d -)" -gt "$(echo $d2 | tr -d -)" ]; then
+ d=$d1
+else
+ d=$d2
+fi
+
+ver=$(echo $d | tr - .)
if [ "$ver" != %{version} ]; then
exit 1
fi
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/GeoIP-db-City.git/commitdiff/1f67771b5020f8391b37e9ed4723a123a046b4f4
More information about the pld-cvs-commit
mailing list