[SCM] PostGIS branch master updated. 3.7.0alpha1-634-gc93627be0

git at osgeo.org git at osgeo.org
Sun Jul 19 06:00:09 PDT 2026


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  c93627be0371a55ef910c96b8417c1b88ce66d3c (commit)
       via  f252696a336bdec65ef01b86e91318d5be6d286c (commit)
      from  a136c7caec18b589295d4477e9207a0fc36eb7fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c93627be0371a55ef910c96b8417c1b88ce66d3c
Merge: a136c7cae f252696a3
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sun Jul 19 06:00:05 2026 -0700

    Merge pull request 'utils: compare upgrade versions numerically' (!437) from Komzpa/postgis:ci/semver-numeric-master-20260719T1138Z into master
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/437


commit f252696a336bdec65ef01b86e91318d5be6d286c
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sun Jul 19 15:40:32 2026 +0400

    utils: compare upgrade versions numerically

diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
index 85edc853a..14e9b51f7 100755
--- a/utils/check_all_upgrades.sh
+++ b/utils/check_all_upgrades.sh
@@ -9,6 +9,7 @@ PGVER_MAJOR=$(echo "${PGVER}" | sed 's/\.[^\.]*//' | sed 's/\(alpha\|beta\|rc\).
 SKIP_LABEL_REGEXP=
 ONLY_EXTENSION=
 ONLY_OLDEST=0
+SELFTEST=0
 echo "INFO: PostgreSQL version: ${PGVER} [${PGVER_MAJOR}]"
 MAKE=$(which gmake make | head -1)
 BUILDDIR=$PWD # TODO: allow override ?
@@ -28,6 +29,7 @@ usage() {
   echo "\t--skip <regexp>  Do not run tests with label matching given extended regexp"
   echo "\t--extension <name>  Only run upgrade tests for the named extension"
   echo "\t--oldest        Only run the oldest compatible upgrade source"
+  echo "\t--self-test     Run check_all_upgrades.sh unit tests"
   echo "Positional parameters:"
   echo "\t<to_version>     Target upgrade version. See regress/run_test.pl help on --upgrade-path <to> parameter."
 }
@@ -43,6 +45,8 @@ while test -n "$1"; do
     ONLY_EXTENSION=$1
   elif test "$1" = "--oldest"; then
     ONLY_OLDEST=1
+  elif test "$1" = "--self-test"; then
+    SELFTEST=1
   elif test "$1" = "-h" -o "$1" = "--help"; then
     usage
     exit 0
@@ -55,7 +59,7 @@ while test -n "$1"; do
   shift
 done
 
-if test -z "$to_version_param"; then
+if test "${SELFTEST}" != 1 && test -z "$to_version_param"; then
   usage >&2
   exit 1
 fi
@@ -84,6 +88,16 @@ semver_compare()
       echo 1; return;
     fi
     V2=`echo "$V2" | cut -d. -sf2-`
+    v1_numeric=`echo "$v1" | sed 's/[^0-9].*//'`
+    v2_numeric=`echo "$v2" | sed 's/[^0-9].*//'`
+    if test -n "$v1_numeric" && test -n "$v2_numeric"; then
+      if [ "$v1_numeric" -lt "$v2_numeric" ]; then
+        echo -1; return;
+      fi
+      if [ "$v1_numeric" -gt "$v2_numeric" ]; then
+        echo 1; return;
+      fi
+    fi
     # echo "v: $v1 - $v2" >&2
     if expr "$v1" '<' "$v2" > /dev/null; then
       echo -1; return;
@@ -250,6 +264,29 @@ report_missing_versions()
   cleanup
 }
 
+check_all_upgrades_selftest()
+{
+  if test "`semver_compare 3.2.7 3.2.11dev`" != "-1"; then
+    echo "FAIL: expected 3.2.7 to compare older than 3.2.11dev" >&2
+    exit 1
+  fi
+
+  if test "`semver_compare 3.2.11dev 3.2.7`" != "1"; then
+    echo "FAIL: expected 3.2.11dev to compare newer than 3.2.7" >&2
+    exit 1
+  fi
+
+  if test "`semver_compare 3.2.11dev 3.2.11dev`" != "0"; then
+    echo "FAIL: expected identical dev versions to compare equal" >&2
+    exit 1
+  fi
+}
+
+if test "${SELFTEST}" = 1; then
+  check_all_upgrades_selftest
+  exit
+fi
+
 
 to_version=$to_version_param
 if expr $to_version : ':auto' >/dev/null; then

-----------------------------------------------------------------------

Summary of changes:
 utils/check_all_upgrades.sh | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list