Skip to content

Commit a8e6ba0

Browse files
committed
fix postgis version detection
1 parent 1878445 commit a8e6ba0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

versions.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,14 @@ declare -A postgisSrcSha256=()
346346
declare -A postgisSrcSha1=()
347347
for variant in ${postgis_versions}; do
348348
_postgisMinor=$(echo "$variant" | cut -d. -f2)
349-
postgisLastTags[$variant]=$(echo "$postgis_all_v3_versions" | grep "^3\.${_postgisMinor}\." | version_reverse_sort | head -n 1 || true)
349+
350+
# check the latest released 3.x version (so not alpha/beta/rc)
351+
postgisLastTags[$variant]=$(echo "$postgis_all_v3_versions" | grep "^3\.${_postgisMinor}\." | grep -v '[a-zA-Z]' | version_reverse_sort | head -n 1 || true)
352+
# Check if the result is empty
353+
if [[ -z "${postgisLastTags[$variant]}" ]]; then
354+
# If empty, run the command again without excluding pre-releases (alpha/beta/rc)
355+
postgisLastTags[$variant]=$(echo "$postgis_all_v3_versions" | grep "^3\.${_postgisMinor}\." | version_reverse_sort | head -n 1 || true)
356+
fi
350357

351358
if [[ ${postgisLastTags[$variant]} =~ [a-zA-Z] ]]; then
352359
postgisLastDockerTags[$variant]=${postgisLastTags[$variant]}

0 commit comments

Comments
 (0)