[postgis-tickets] r16338 - Properly handle upgrade of sfcgal and topology from unpackaged.

Sandro Santilli strk at kbt.io
Fri Jan 19 03:13:35 PST 2018


Author: strk
Date: 2018-01-19 03:13:35 -0800 (Fri, 19 Jan 2018)
New Revision: 16338

Modified:
   trunk/regress/run_test.pl
Log:
Properly handle upgrade of sfcgal and topology from unpackaged.

Also add some more informational output

Modified: trunk/regress/run_test.pl
===================================================================
--- trunk/regress/run_test.pl	2018-01-19 09:27:17 UTC (rev 16337)
+++ trunk/regress/run_test.pl	2018-01-19 11:13:35 UTC (rev 16338)
@@ -1465,6 +1465,13 @@
     if ( $OPT_WITH_TOPO )
     {
       my $sql = "ALTER EXTENSION postgis_topology UPDATE TO '${nextver}'";
+
+			if ( $OPT_UPGRADE_FROM eq "unpackaged" ) {
+				$sql = "CREATE EXTENSION postgis_topology VERSION '${nextver}' FROM unpackaged";
+			}
+
+			print "Upgrading PostGIS Topology in '${DB}' using: ${sql}\n" ;
+
       my $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
       my $rv = system($cmd);
       if ( $rv ) {
@@ -1476,7 +1483,11 @@
     if ( $OPT_WITH_SFCGAL )
     {
 			my $sql;
-			if ( semver_lessthan($OPT_UPGRADE_FROM, "2.2.0") )
+
+			if ( $OPT_UPGRADE_FROM eq "unpackaged" ) {
+				$sql = "CREATE EXTENSION postgis_sfcgal VERSION '${nextver}' FROM unpackaged";
+			}
+			elsif ( semver_lessthan($OPT_UPGRADE_FROM, "2.2.0") )
 			{
 				print "NOTICE: installing SFCGAL extension on upgrade "
 						. "as it was not available in version $OPT_UPGRADE_FROM\n";
@@ -1487,6 +1498,9 @@
 				$sql = "ALTER EXTENSION postgis_sfcgal UPDATE TO '${nextver}'";
 			}
       $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+
+			print "Upgrading PostGIS SFCGAL in '${DB}' using: ${sql}\n" ;
+
       $rv = system($cmd);
       if ( $rv ) {
         fail "Error encountered creating EXTENSION POSTGIS_SFCGAL", $REGRESS_LOG;



More information about the postgis-tickets mailing list