summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit user2023-09-04 14:15:33 +0200
committergit user2023-09-04 14:15:33 +0200
commite9b141973665f5950e28726efc9f5ab7c947b1f1 (patch)
treeddb2f47daa4aa092214953b58bbaaaae7c9eeb87
parent4ee9df4361371091ab8f8ff6eac6e89d9580c397 (diff)
downloadaur-e9b141973665f5950e28726efc9f5ab7c947b1f1.tar.gz
Switched to version-aware source download target.
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD20
2 files changed, 18 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 414c802e50f0..c862b67b1554 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = idos-timetable-additionalinfo-chaps-mhd-pid-latest
pkgdesc = Photographs of some stops within the PID (Praha region) public transport area, to be used with the timetable search engines by CHAPS.
- pkgver = 2021_5_5
- pkgrel = 1
+ pkgver = 2023_2_15
+ pkgrel = 2
epoch = 0
url = http://chaps.cz/eng/download/idos/zip#kotvainf
arch = any
@@ -9,10 +9,10 @@ pkgbase = idos-timetable-additionalinfo-chaps-mhd-pid-latest
license = custom
makedepends = wget
depends = idos-timetable-data-mhd-pid
- provides = idos-timetable-additionalinfo-chaps-mhd-pid=2021_5_5
- provides = idos-timetable-additionalinfo-mhd-pid=2021_5_5
+ provides = idos-timetable-additionalinfo-chaps-mhd-pid=2023_2_15
+ provides = idos-timetable-additionalinfo-mhd-pid=2023_2_15
conflicts = idos-timetable-additionalinfo-chaps-mhd-pid
- source = cpid.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/CPID.ZIP
+ source = cpid-2023_2_15.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/CPID.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 167bb106444c..f6ef55faa4df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,21 @@
# Maintainer: dreieck
-# PKGBUILD last time manually edited: At least on 2021-07-04.
+# PKGBUILD last time manually edited: At least on 2023-09-04.
+url="http://chaps.cz/eng/download/idos/zip#kotvainf"
+_zipfile="CPID.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]+'
+}
_pkgname=idos-timetable-additionalinfo-chaps-mhd-pid
pkgname="${_pkgname}-latest"
epoch=0
-pkgver=2021_5_5
-pkgrel=1
+_pkgver="$(_pkgver)" # This should be set _before_ sources get downloaded.
+pkgver="${_pkgver}"
+pkgrel=2
pkgdesc="Photographs of some stops within the PID (Praha region) public transport area, to be used with the timetable search engines by CHAPS."
arch=('any')
-url="http://chaps.cz/eng/download/idos/zip#kotvainf"
license=('custom')
groups=(
@@ -36,10 +42,10 @@ conflicts=(
"${_pkgname}"
)
-_target="cpid.zip"
+_target="cpid-${_pkgver}.zip"
source=(
- "${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/CPID.ZIP"
+ "${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}"
"IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf"
"license-dummy.txt"
)
@@ -51,7 +57,7 @@ sha256sums=(
)
pkgver() {
- wget -nv -O- "${url}" | tr -d '\a' | tr '\n' '\a' | sed 's|^.*File CPID.ZIP\(.*\)Zip/CPID.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]+'
+ printf '%s' "${_pkgver}"
}