]> granicus.if.org Git - postgis/commitdiff
Properly handle upgrade of sfcgal and topology from unpackaged.
authorSandro Santilli <strk@kbt.io>
Fri, 19 Jan 2018 11:13:35 +0000 (11:13 +0000)
committerSandro Santilli <strk@kbt.io>
Fri, 19 Jan 2018 11:13:35 +0000 (11:13 +0000)
Also add some more informational output

git-svn-id: http://svn.osgeo.org/postgis/trunk@16338 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test.pl

index 03bc5dde43b6f60699c987dcaf0d7d3851ce64da..8d0e45d96a10869feb50b0436961b12abeffa3ad 100755 (executable)
@@ -1465,6 +1465,13 @@ sub upgrade_spatial_extensions
     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 @@ sub upgrade_spatial_extensions
     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 @@ sub upgrade_spatial_extensions
                                $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;