summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit user2023-09-04 13:57:34 +0200
committergit user2023-09-04 13:57:34 +0200
commit90b7b5619bef803cbbb3aef5cdbf330474254fed (patch)
tree82286131da14e307d3943749455911b719b4dc21
parentc46aa35dd2a4276ec642a46c31c2b9b13dc4d138 (diff)
downloadaur-90b7b5619bef803cbbb3aef5cdbf330474254fed.tar.gz
Switched to version-aware source download target.
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD17
2 files changed, 15 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 58c7dcac43ce..f15c22d68680 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = idos-timetable-data-chaps-trains-common-latest
pkgdesc = Common files needed for train timetable data for the timetable search engines by CHAPS.
- pkgver = 2023_05_17
+ pkgver = 2023_09_01
pkgrel = 1
epoch = 0
url = http://chaps.cz/eng/download/idos/zip#kotvatt
@@ -9,10 +9,10 @@ pkgbase = idos-timetable-data-chaps-trains-common-latest
license = custom
makedepends = wget
depends = idos-timetable-browser
- provides = idos-timetable-data-chaps-trains-common=2023_05_17
- provides = idos-timetable-data-trains-common=2023_05_17
+ provides = idos-timetable-data-chaps-trains-common=2023_09_01
+ provides = idos-timetable-data-trains-common=2023_09_01
conflicts = idos-timetable-data-chaps-trains-common
- source = vlak23c.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/VLAK23C.ZIP
+ source = vlak23c-2023_09_01.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/VLAK23C.ZIP
source = IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf
source = license-dummy.txt
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 239d9d2d3ff3..f8b0fc8134de 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,17 +1,23 @@
# Maintainer: dreieck
-# PKGBUILD last time manually edited: At least on 2023-05-17.
+# PKGBUILD last time manually edited: At least on 2023-09-04.
_year=23
+url="http://chaps.cz/eng/download/idos/zip#kotvatt"
+_zipfile="VLAK${_year}C.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-data-chaps-trains-common
pkgname="${_pkgname}-latest"
epoch=0
-pkgver=2023_05_17
+_pkgver="$(_pkgver)" # This should be set _before_ sources get downloaded.
+pkgver="${_pkgver}"
pkgrel=1
pkgdesc="Common files needed for train timetable data for the timetable search engines by CHAPS."
arch=(any)
-url="http://chaps.cz/eng/download/idos/zip#kotvatt"
license=('custom')
groups=(
@@ -37,8 +43,7 @@ conflicts=(
"${_pkgname}"
)
-_zipfile="VLAK${_year}C.ZIP"
-_target="vlak${_year}c.zip"
+_target="vlak${_year}c-${_pkgver}.zip"
source=(
"${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}"
@@ -53,7 +58,7 @@ sha256sums=(
)
pkgver() {
- 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'
+ printf '%s' "${_pkgver}"
}