[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-99-gc1b8d14

git at osgeo.org git at osgeo.org
Tue Oct 27 14:52:51 PDT 2020


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  c1b8d14d8900dc835fd5782f364364ffa963919e (commit)
      from  06fa4cfd3991a33b5d1bda3bb7cc7888ffeb52b3 (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 c1b8d14d8900dc835fd5782f364364ffa963919e
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 27 22:52:27 2020 +0100

    Have check_cluster_upgrade.sh support init script

diff --git a/utils/check_cluster_upgrade.sh b/utils/check_cluster_upgrade.sh
index 0450194..8b530a6 100755
--- a/utils/check_cluster_upgrade.sh
+++ b/utils/check_cluster_upgrade.sh
@@ -3,6 +3,7 @@
 TMPDIR=/tmp/pgis_upgrade_test-$$/
 DATADIR=${TMPDIR}/cluster
 LOGFILE=${TMPDIR}/log
+INIT_SCRIPT=
 export PGPORT=15432
 export PGHOST=${TMPDIR}
 export PGDATABASE=pgis
@@ -10,7 +11,7 @@ PG_CONFIG_OLD=
 PG_CONFIG_NEW=
 
 usage() {
-  echo "Usage: $0 <pg_config> <pg_config>"
+  echo "Usage: $0 [-i <init_script>] <pg_config_old> <pg_config_new>"
 }
 
 cleanup() {
@@ -23,7 +24,11 @@ trap 'cleanup' EXIT
 mkdir -p ${TMPDIR}
 
 while test -n "$1"; do
-  if test -z "$PG_CONFIG_OLD"; then
+  if test "$1" = "-i"; then
+    shift
+    INIT_SCRIPT=$1
+    shift
+  elif test -z "$PG_CONFIG_OLD"; then
     PG_CONFIG_OLD="$1"
     shift
   elif test -z "$PG_CONFIG_NEW"; then
@@ -66,10 +71,16 @@ ${BIN_OLD}/pg_ctl -D ${DATADIR} -o "-F -p ${PGPORT} -k ${TMPDIR}" -l ${LOGFILE}
 
 echo "Creating FROM db"
 ${BIN_OLD}/createdb pgis || exit 1
-${BIN_OLD}/psql -c "CREATE EXTENSION postgis" || exit 1
+
+#TODO: run an custom script
+if test -n "$INIT_SCRIPT"; then
+  ${BIN_OLD}/psql -X --set ON_ERROR_STOP=1 -f "$INIT_SCRIPT" || exit 1
+else
+  ${BIN_OLD}/psql -Xc --set ON_ERROR_STOP=1 "CREATE EXTENSION postgis" || exit 1
+fi
 
 echo "---- OLD cluster info -------------------------"
-${BIN_OLD}/psql -XAt <<EOF || exit 1
+${BIN_OLD}/psql -XAt --set ON_ERROR_STOP=1 <<EOF || exit 1
 SELECT version();
 SELECT postgis_full_version();
 EOF

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

Summary of changes:
 utils/check_cluster_upgrade.sh | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list