From 3302732cc57ceeef5f18b9315cf754bbf22942ed Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 22 Aug 2019 09:20:42 +0000 Subject: [PATCH] [run_test] Allow requesting function upgrade also w/out :auto Append an exlamation mark to any target version in upgrade-path to request upgrade via function... git-svn-id: http://svn.osgeo.org/postgis/trunk@17752 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/run_test.pl | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/regress/run_test.pl b/regress/run_test.pl index dbc4bad32..1a6d4e739 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -547,8 +547,9 @@ Options: can be specified as "unpackaged" to specify a script version to start from. can be specified as ":auto" to request - upgrades to default version, and ":auto!" - to request upgrade via postgis_extensions_upgrade() + upgrades to default version, and be appended + a question mark (ie: ":auto!" or "3.0.0!") to + request upgrade via postgis_extensions_upgrade() if available. --dumprestore dump and restore spatially-enabled db before running tests --nodrop do not drop the regression database on exit @@ -1514,23 +1515,25 @@ sub upgrade_spatial_extensions my $sql; my $upgrade_via_function = 0; - if ( $OPT_UPGRADE_TO =~ /^:auto/ ) + if ( $OPT_UPGRADE_TO =~ /!$/ ) { - if ( $OPT_UPGRADE_TO =~ /^:auto!/ ) + $OPT_UPGRADE_TO =~ s/!$//; + my $from = $OPT_UPGRADE_FROM; + $from =~ s/^unpackaged//; + if ( ! $from || ! semver_lessthan($from, "3.0.0") ) { - my $from = $OPT_UPGRADE_FROM; - $from =~ s/^unpackaged//; - if ( ! $from || ! semver_lessthan($from, "3.0.0") ) - { - $upgrade_via_function = 1; - } - else - { - print "WARNING: postgis_extensions_upgrade()". - " not available or functional in version $from.". - " We'll use manual upgrade.\n"; - } + $upgrade_via_function = 1; } + else + { + print "WARNING: postgis_extensions_upgrade()". + " not available or functional in version $from.". + " We'll use manual upgrade.\n"; + } + } + + if ( $OPT_UPGRADE_TO =~ /^:auto/ ) + { $OPT_UPGRADE_TO = $defextver; } -- 2.40.0