[SCM] PostGIS branch master updated. 3.6.0rc2-13-g74a2b2fd3

git at osgeo.org git at osgeo.org
Wed Aug 27 03:17:53 PDT 2025


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  74a2b2fd328dd5e436a63a21172e1add8d36954d (commit)
      from  3ea4508d80bef85ddd242230eb12d5c3ec5f08df (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 74a2b2fd328dd5e436a63a21172e1add8d36954d
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Aug 26 15:52:11 2025 +0200

    Merge check_all_downgrades into check_all_upgrades
    
    References #5977

diff --git a/utils/check_all_downgrades.sh b/utils/check_all_downgrades.sh
deleted file mode 100755
index 45b9c48f4..000000000
--- a/utils/check_all_downgrades.sh
+++ /dev/null
@@ -1,280 +0,0 @@
-#!/bin/sh
-
-EXIT_ON_FIRST_FAILURE=0
-EXTDIR=`pg_config --sharedir`/extension/
-CTBDIR=`pg_config --sharedir`/contrib/
-TMPDIR=/tmp/check_all_upgrades-$$-tmp
-PGVER=`pg_config --version | awk '{print $2}'`
-PGVER_MAJOR=$(echo "${PGVER}" | sed 's/\.[^\.]*//' | sed 's/\(alpha\|beta\|rc\).*//' )
-SKIP_LABEL_REGEXP=
-MAKE=$(which gmake make | head -1)
-BUILDDIR=$PWD # TODO: allow override ?
-
-cd $(dirname $0)/..
-SRCDIR=$PWD # TODO: allow override ?
-cd - > /dev/null
-
-MAKE_ARGS="TESTS=${SRCDIR}/regress/core/regress.sql"
-
-# This is useful to run database queries
-export PGDATABASE=template1
-
-usage() {
-  echo "Usage: $0 [-s] <to_version>"
-  echo "Options:"
-  echo "\t-s  Stop on first failure"
-  echo "\t--skip <regexp>  Do not run tests with label matching given extended regexp"
-}
-
-while test -n "$1"; do
-  if test "$1" = "-s"; then
-    EXIT_ON_FIRST_FAILURE=1
-  elif test "$1" = "--skip"; then
-    shift
-    SKIP_LABEL_REGEXP=$1
-  elif test -z "$to_version_param"; then
-    to_version_param="$1"
-  else
-    usage >&2
-    exit 1
-  fi
-  shift
-done
-
-if test -z "$to_version_param"; then
-  usage >&2
-  exit 1
-fi
-
-mkdir -p ${TMPDIR}
-cleanup()
-{
-  echo "Cleaning up"
-  rm -rf ${TMPDIR}
-}
-
-trap 'cleanup' EXIT
-
-
-# Return -1, 1 or 0 if the first version
-# is respectively smaller, greater or equal
-# to the second version
-semver_compare()
-{
-  V1=`echo "$1" | tr '.' ' '`
-  V2=$2
-  # echo "V1: $V1" >&2
-  # echo "V2: $V2" >&2
-  for v1 in $V1; do
-    v2=`echo "$V2" | cut -d. -f1`
-    if [ -z "$v2" ]; then
-      echo 1; return;
-    fi
-    V2=`echo "$V2" | cut -d. -sf2-`
-    # echo "v: $v1 - $v2" >&2
-    if expr "$v1" '<' "$v2" > /dev/null; then
-      echo -1; return;
-    fi
-    if expr "$v1" '>' "$v2" > /dev/null; then
-      echo 1; return;
-    fi
-  done
-  if [ -n "$V2" ]; then
-    echo -1; return;
-  fi
-  echo 0; return;
-}
-
-failed()
-{
-  failures=$((failures+1))
-  if test $EXIT_ON_FIRST_FAILURE != 0; then
-    exit $failures
-  fi
-}
-
-minimum_postgis_version_for_postgresql_major_version()
-{
-  pgver=$1
-  supportfile=${TMPDIR}/minimum_supported_version_for_postgresql
-
-  if ! test -e ${supportfile}; then
-    # Source: https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS
-    cat > ${supportfile} <<EOF
-9.6:2.3
-10:2.4
-11:2.5
-12:2.5
-13:3.0
-14:3.1
-15:3.2
-16:3.3
-17:3.3
-EOF
-  fi
-
-  # Drop patch-level number from PostgreSQL version
-  minsupported=`grep ^${pgver}: ${supportfile} | cut -d: -f2`
-  test -n "${minsupported}" || {
-    echo "Cannot determine minimum supported PostGIS version for PostgreSQL major version ${pgver}" >&2
-    exit 1
-  }
-  echo "${minsupported}"
-}
-
-kept_label()
-{
-  label=$1
-
-  if test -n "${SKIP_LABEL_REGEXP}"; then
-    if echo "${label}" | egrep -q "${SKIP_LABEL_REGEXP}"; then
-      echo "SKIP: $label (matches regexp '${SKIP_LABEL_REGEXP}')"
-      return 1;
-    fi
-  fi
-
-  return 0;
-}
-
-is_downgrade()
-{
-  label=$1
-  from=$2
-  to=$3
-
-  #echo "XXXX is_downgrade: upgrade_path=${upgrade_path}"
-  #echo "XXXX is_downgrade: from=${from}"
-  #echo "XXXX is_downgrade: to=${to}"
-
-  # only consider versions newer than ${to}
-  cmp=`semver_compare "${from}" "${to}"`
-  #echo "INFO: semver_compare ${from} ${to} returned $cmp"
-  if test $cmp -le 0; then
-    echo "SKIP: $label ($to is not newer than $from)"
-    return 1
-  fi
-  cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
-  if test $cmp -gt 0; then
-    echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
-    return 1
-  fi
-
-  return 0
-}
-
-check_downgrade()
-{
-  RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
-  ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} > ${TMPDIR}/log 2>&1
-  if test $? = 0; then
-    echo "FAIL: ${test_label} did not error out:"
-    tail ${TMPDIR}/log
-    failed
-  else
-    ERR=$( grep 'ERROR:.*Downgrade .* forbidden' ${TMPDIR}/log )
-    test -n "$ERR" && {
-      echo "PASS: ${test_label} gave $ERR"
-    } || {
-      echo "FAIL: ${test_label} gave some other error:"
-      tail ${TMPDIR}/log
-      failed
-    }
-  fi
-}
-
-
-to_version=$to_version_param
-if expr $to_version : ':auto' >/dev/null; then
-  ARGS=
-  if test -n "${SKIP_LABEL_REGEXP}"; then
-    ARGS="${ARGS} --skip ${SKIP_LABEL_REGEXP}"
-  fi
-  if test $EXIT_ON_FIRST_FAILURE != 0; then
-    ARGS="${ARGS} -s"
-  fi
-  for version in $(
-    psql -XAtc "select version from pg_available_extension_versions where name = 'postgis' and version ~ '^[0-9]'"
-  ); do
-    $0 ${ARGS} ${version} || failed
-  done
-  exit $failures
-fi
-
-
-echo "INFO: PostgreSQL version: ${PGVER} [${PGVER_MAJOR}]"
-PGIS_MIN_VERSION=`minimum_postgis_version_for_postgresql_major_version "${PGVER_MAJOR}"`
-echo "INFO: minimum PostGIS version supporting PostgreSQL ${PGVER_MAJOR}: ${PGIS_MIN_VERSION}"
-
-
-cd $EXTDIR
-failures=0
-
-INSTALLED_EXTENSIONS=postgis
-if test -f postgis_topology--${to_version}.sql; then
-  INSTALLED_EXTENSIONS="$INSTALLED_EXTENSIONS postgis_topology"
-fi
-if test -f postgis_raster--${to_version}.sql; then
-  INSTALLED_EXTENSIONS="$INSTALLED_EXTENSIONS postgis_raster"
-fi
-if test -f postgis_sfcgal--${to_version}.sql; then
-  INSTALLED_EXTENSIONS="$INSTALLED_EXTENSIONS postgis_sfcgal"
-fi
-
-echo "INFO: installed extensions: $INSTALLED_EXTENSIONS"
-
-USERTESTFLAGS=${RUNTESTFLAGS}
-
-for EXT in ${INSTALLED_EXTENSIONS}; do #{
-  if test "${EXT}" = "postgis"; then
-    REGDIR=${BUILDDIR}/regress
-  elif test "${EXT}" = "postgis_topology"; then
-    REGDIR=${BUILDDIR}/topology/test
-  elif test "${EXT}" = "postgis_raster"; then
-    REGDIR=${BUILDDIR}/raster/test/regress
-  elif test "${EXT}" = "postgis_sfcgal"; then
-    REGDIR=${BUILDDIR}/sfcgal/regress
-  else
-    echo "SKIP: don't know where to find regress tests for extension ${EXT}"
-  fi
-
-  # Check extension->extension downgrades
-  files=`'ls' ${EXT}--* | grep -v -- '--.*--' | sed "s/^${EXT}--\(.*\)\.sql/\1/"`
-  for fname in $files; do
-    from_version="$fname"
-    if test "$from_version" = "unpackaged"; then
-      # We deal with unpackaged tests separately
-      continue;
-    fi
-    UPGRADE_PATH="${from_version}--${to_version_param}"
-    test_label="${EXT} extension downgrade ${UPGRADE_PATH}"
-    if expr $to_version_param : ':auto' >/dev/null; then
-      test_label="${test_label} ($to_version)"
-    fi
-    kept_label "${test_label}" || continue
-    is_downgrade "${test_label}" ${from_version} ${to_version} || continue
-    path=$( psql -XAtc "
-        SELECT path
-        FROM pg_catalog.pg_extension_update_paths('${EXT}')
-        WHERE source = '${from_version}'
-        AND target = '${to_version}'
-    " ) || exit 1
-    if test -z "${path}"; then
-      echo "SKIP: ${test_label} (no downgrade path from ${from_version} to ${to_version} known by postgresql)"
-      continue
-    fi
-    echo "Testing ${test_label}"
-    check_downgrade
-
-    test_label="${test_label} with standard-conforming-strings off"
-    echo "Testing ${test_label}"
-    USERTESTFLAGS="\
-      ${USERTESTFLAGS} \
-      --before-upgrade-script ${SRCDIR}/regress/hooks/standard-conforming-strings-off.sql \
-    " check_downgrade
-  done
-
-  # TODO: Check unpackaged->unpackaged downgrades (if target version == current version)
-
-done #}
-
-exit $failures
diff --git a/utils/check_all_upgrades.sh b/utils/check_all_upgrades.sh
index 0670ab65d..04471616d 100755
--- a/utils/check_all_upgrades.sh
+++ b/utils/check_all_upgrades.sh
@@ -135,6 +135,21 @@ kept_label()
   return 0;
 }
 
+# Usage: compatible_from <label> <from>
+compatible_from()
+{
+  label=$1
+  from=$2
+  cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
+  if test $cmp -gt 0; then
+    echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+    return 1
+  fi
+
+  return 0
+}
+
+# Usage: compatible_upgrade <label> <from> <to>
 compatible_upgrade()
 {
   label=$1
@@ -152,13 +167,32 @@ compatible_upgrade()
     echo "SKIP: $label ($to is not newer than $from)"
     return 1
   fi
-  cmp=`semver_compare "${PGIS_MIN_VERSION}" "${from}"`
-  if test $cmp -gt 0; then
-    echo "SKIP: $label ($from older than ${PGIS_MIN_VERSION}, which is required to run in PostgreSQL ${PGVER})"
+
+  if compatible_from $label $from; then
+    return 0
+  else
     return 1
   fi
+}
 
-  return 0
+check_downgrade()
+{
+  RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+  ${MAKE} -C ${REGDIR} check "TESTS=${SRCDIR}/regress/core/regress.sql" ${MAKE_ARGS} > ${TMPDIR}/log 2>&1
+  if test $? = 0; then
+    echo "FAIL: ${test_label} did not error out:"
+    tail ${TMPDIR}/log
+    failed
+  else
+    ERR=$( grep 'ERROR:.*Downgrade .* forbidden' ${TMPDIR}/log )
+    test -n "$ERR" && {
+      echo "PASS: ${test_label} gave $ERR"
+    } || {
+      echo "FAIL: ${test_label} gave some other error:"
+      tail ${TMPDIR}/log
+      failed
+    }
+  fi
 }
 
 report_missing_versions()
@@ -233,12 +267,26 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
       continue;
     fi
     UPGRADE_PATH="${from_version}--${to_version_param}"
-    test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+
+    cmp=`semver_compare "${from_version}" "${to_version}"`
+    #echo "INFO: semver_compare ${from} ${to} returned $cmp"
+    if test $cmp -eq 0; then
+      echo "SKIP: ${from_version} -> ${to_version} (we won't test same-version upgrade/downgrade here)"
+      continue;
+    fi
+
+    if test $cmp -lt 0; then
+      test_label="${EXT} extension upgrade ${UPGRADE_PATH}"
+    else
+      test_label="${EXT} extension downgrade ${UPGRADE_PATH}"
+    fi
+
     if expr $to_version_param : ':auto' >/dev/null; then
       test_label="${test_label} ($to_version)"
     fi
+
     kept_label "${test_label}" || continue
-    compatible_upgrade "${test_label}" ${from_version} ${to_version} || continue
+
     path=$( psql -XAtc "
         SELECT path
         FROM pg_catalog.pg_extension_update_paths('${EXT}')
@@ -250,14 +298,30 @@ for EXT in ${INSTALLED_EXTENSIONS}; do #{
       MISSING_EXT_UPGRADES="${from_version} ${MISSING_EXT_UPGRADES}"
       continue
     fi
+
+    compatible_from "${test_label}" ${from_version} || continue
+
     echo "Testing ${test_label}"
-    RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
-    ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
-      echo "PASS: ${test_label}"
-    } || {
-      echo "FAIL: ${test_label}"
-      failed
-    }
+
+    if expr "${test_label}" : '^.*upgrade' > /dev/null; then
+      RUNTESTFLAGS="-v --extension --upgrade-path=${UPGRADE_PATH} ${USERTESTFLAGS}" \
+      ${MAKE} -C ${REGDIR} check ${MAKE_ARGS} && {
+        echo "PASS: ${test_label}"
+      } || {
+        echo "FAIL: ${test_label}"
+        failed
+      }
+    else
+      check_downgrade
+
+      test_label="${test_label} with standard-conforming-strings off"
+      echo "Testing ${test_label}"
+      USERTESTFLAGS="\
+        ${USERTESTFLAGS} \
+        --before-upgrade-script ${SRCDIR}/regress/hooks/standard-conforming-strings-off.sql \
+      " check_downgrade
+    fi
+
   done
 
   if ! kept_label "unpackaged"; then

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

Summary of changes:
 utils/check_all_downgrades.sh | 280 ------------------------------------------
 utils/check_all_upgrades.sh   |  90 ++++++++++++--
 2 files changed, 77 insertions(+), 293 deletions(-)
 delete mode 100755 utils/check_all_downgrades.sh


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list