]> granicus.if.org Git - postgis/commitdiff
Upgrade SFCGAL too when requested
authorSandro Santilli <strk@kbt.io>
Tue, 9 Jan 2018 18:36:02 +0000 (18:36 +0000)
committerSandro Santilli <strk@kbt.io>
Tue, 9 Jan 2018 18:36:02 +0000 (18:36 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@16239 b70326c6-7e19-0410-871a-916f4a2858ee

regress/run_test.pl

index 4ee45c56230d0e7b5d71c5568201b3320f5d6684..7de5e8270c3542356b3d54d2e7b843fd3529d914 100755 (executable)
@@ -1398,6 +1398,22 @@ sub upgrade_spatial
             die "$script not found\n";
         }
     }
+
+    if ( $OPT_WITH_SFCGAL )
+    {
+        my $script = `ls ${STAGED_SCRIPTS_DIR}/sfcgal_upgrade.sql`;
+        chomp($script);
+        if ( -e $script )
+        {
+            print "Upgrading sfcgal\n";
+            load_sql_file($script);
+        }
+        else
+        {
+            die "$script not found\n";
+        }
+    }
+
     return 1;
 }
 
@@ -1434,6 +1450,17 @@ sub upgrade_spatial_extensions
       }
     }
 
+    if ( $OPT_WITH_SFCGAL )
+    {
+      my $sql = "ALTER EXTENSION postgis_sfcgal UPDATE TO '${nextver}'";
+      $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1";
+      $rv = system($cmd);
+      if ( $rv ) {
+        fail "Error encountered creating EXTENSION POSTGIS_SFCGAL", $REGRESS_LOG;
+        die;
+      }
+    }
+
     return 1;
 }