[postgis-tickets] r16840 - [run_test] Drop raster if needed when enforced by extension

Sandro Santilli strk at kbt.io
Mon Sep 24 03:18:15 PDT 2018


Author: strk
Date: 2018-09-24 03:18:15 -0700 (Mon, 24 Sep 2018)
New Revision: 16840

Modified:
   trunk/regress/run_test.pl
Log:
[run_test] Drop raster if needed when enforced by extension

Modified: trunk/regress/run_test.pl
===================================================================
--- trunk/regress/run_test.pl	2018-09-24 10:06:13 UTC (rev 16839)
+++ trunk/regress/run_test.pl	2018-09-24 10:18:15 UTC (rev 16840)
@@ -1509,7 +1509,31 @@
         }
       }
     }
+		else
+		{
+			# Raster support was not requested, so drop it if
+			# left unpackaged
+      if ( $OPT_UPGRADE_FROM
+           && ! has_split_raster_ext($OPT_UPGRADE_FROM) )
+			{
+        $sql = "CREATE EXTENSION postgis_raster VERSION '${nextver}' FROM unpackaged";
+        $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+        $rv = system($cmd);
+        if ( $rv ) {
+          fail "Error encountered creating EXTENSION POSTGIS_RASTER from unpackaged on upgrade", $REGRESS_LOG;
+          die;
+        }
 
+        $sql = "DROP EXTENSION postgis_raster";
+        $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+        $rv = system($cmd);
+        if ( $rv ) {
+          fail "Error encountered dropping EXTENSION POSTGIS_RASTER on upgrade", $REGRESS_LOG;
+          die;
+        }
+			}
+		}
+
     if ( $OPT_WITH_TOPO )
     {
       my $sql = "ALTER EXTENSION postgis_topology UPDATE TO '${nextver}'";



More information about the postgis-tickets mailing list