From eb9c9ed7146a95d101bdf247df105dc223604e2d Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 28 Sep 2015 07:40:13 +0000 Subject: [PATCH] Add support for creating extension from unpackaged (#3296) Use: ./run_test.pl --extension --upgrade-path unpackaged--2.2.0 git-svn-id: http://svn.osgeo.org/postgis/trunk@14119 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/run_test.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/regress/run_test.pl b/regress/run_test.pl index 3cf09327b..ae5cd42d2 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -97,6 +97,11 @@ if ( $OPT_UPGRADE_PATH ) print "Upgrade path: ${OPT_UPGRADE_FROM} --> ${OPT_UPGRADE_TO}\n"; } +if ( $OPT_EXTENSIONS ) +{ + $OPT_WITH_RASTER = 1; # implied +} + ################################################################## @@ -1241,6 +1246,10 @@ sub prepare_spatial_extensions my $psql_opts = "--no-psqlrc --variable ON_ERROR_STOP=true"; my $sql = "CREATE EXTENSION postgis"; if ( $OPT_UPGRADE_FROM ) { + if ( $OPT_UPGRADE_FROM eq "unpackaged" ) { + prepare_spatial(); + return; + } $sql .= " VERSION '" . $OPT_UPGRADE_FROM . "'"; } @@ -1376,6 +1385,10 @@ sub upgrade_spatial_extensions my $nextver = $OPT_UPGRADE_TO ? "${OPT_UPGRADE_TO}" : "${libver}next"; my $sql = "ALTER EXTENSION postgis UPDATE TO '${nextver}'"; + if ( $OPT_UPGRADE_FROM eq "unpackaged" ) { + $sql = "CREATE EXTENSION postgis VERSION '${nextver}' FROM unpackaged"; + } + print "Upgrading PostGIS in '${DB}' using: ${sql}\n" ; my $cmd = "psql $psql_opts -c \"" . $sql . "\" $DB >> $REGRESS_LOG 2>&1"; -- 2.50.1