summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorgit user2023-09-04 13:40:46 +0200
committergit user2023-09-04 13:40:46 +0200
commitb2ac8277133dde6a8fd01931fe85200b7080a722 (patch)
tree1f8adfb1c4ebd13322c8f4b6bd68cceef229fea5 /PKGBUILD
parentc9614dfb784e3653b844012c717cda4c737cef2a (diff)
downloadaur-b2ac8277133dde6a8fd01931fe85200b7080a722.tar.gz
Switched to version-aware source download target.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD21
1 files changed, 14 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5bf47679e139..e6b79c67579d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,22 @@
# Maintainer: dreieck
-# PKGBUILD last time manually edited: At least on 2023-05-17.
+# PKGBUILD last time manually edited: At least on 2023-09-04.
+
+url="http://chaps.cz/eng/download/idos/zip#kotvatar"
+_zipfile="KOMPLET_P.ZIP"
+_pkgver() {
+ # Reason for a _pkgver(): Have something to run before source download so that we can have version aware source downloads.
+ wget -nv -O- "${url}" | tr -d '\a' | tr '\n' '\a' | sed 's|^.*File '"${_zipfile}"'\(.*\)Zip/'"${_zipfile}"'.*$|\1\n|g' | tr '\a' '\n' | grep 'Update date:' | cut -d, -f1 | sed -r 's|([0-9]+)\.([0-9]+)\.([0-9]+).|\n\3_\2_\1\n|g' | grep -E '^[0-9]+_[0-9]+_[0-9]+' | sed -E -e 's|_([0-9])_|_0\1_|g' -e 's|_([0-9])$|_0\1|g'
+}
_pkgname=idos-timetable-tariff-chaps-all
pkgname="${_pkgname}-latest"
epoch=0
-pkgver=2023_05_17
-pkgrel=1
+_pkgver="$(_pkgver)" # This should be set _before_ sources get downloaded.
+pkgver="${_pkgver}"
+pkgrel=2
pkgdesc="Tariff data for the timetable search engines by CHAPS: Czech/Slovak trains + bus, Czech public transport. Note that some data need the purchased version of IDOS to run."
arch=(any)
-url="http://chaps.cz/eng/download/idos/zip#kotvatar"
license=('custom')
groups=(
@@ -240,10 +247,10 @@ conflicts=(
"idos-timetable-tariff-mhd-zdarns"
)
-_target='komplet_p.zip'
+_target="komplet_p-${_pkgver}.zip"
source=(
- "${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/KOMPLET_P.ZIP"
+ "${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}"
"IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf"
"license-dummy.txt"
)
@@ -255,7 +262,7 @@ sha256sums=(
)
pkgver() {
- wget -nv -O- "${url}" | tr -d '\a' | tr '\n' '\a' | sed 's|^.*File KOMPLET_P.ZIP\(.*\)Zip/KOMPLET_P.ZIP.*$|\1\n|g' | tr '\a' '\n' | grep 'Update date:' | cut -d, -f1 | sed -r 's|([0-9]+)\.([0-9]+)\.([0-9]+).|\n\3_\2_\1\n|g' | grep -E '^[0-9]+_[0-9]+_[0-9]+' | sed -E -e 's|_([0-9])_|_0\1_|g' -e 's|_([0-9])$|_0\1|g'
+ printf '%s' "${_pkgver}"
}