Commit 833b6486 authored by Sandro Santilli's avatar Sandro Santilli

Properly handle upgrade of sfcgal and topology from unpackaged.

Also add some more informational output

git-svn-id: http://svn.osgeo.org/postgis/trunk@16338 b70326c6-7e19-0410-871a-916f4a2858ee
parent d47a9f44
Pipeline #16361309 passed with stage
in 25 minutes and 8 seconds
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment