[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-592-g4bcdc9685

git at osgeo.org git at osgeo.org
Fri Feb 10 01:00:12 PST 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  4bcdc968534100cb8b316c166f2513ffa09a03e9 (commit)
      from  88dc5fc785c8aab517cf538772261e232f5bea54 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4bcdc968534100cb8b316c166f2513ffa09a03e9
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri Feb 10 09:59:35 2023 +0100

    Allow run_test.pl to be used with system loaders or without loaders

diff --git a/regress/run_test.pl b/regress/run_test.pl
index 4f2c3d3f3..12b3e889c 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -16,7 +16,7 @@
 use File::Basename;
 use File::Temp 'tempdir';
 use Time::HiRes qw(time);
-#use File::Which;
+use File::Which;
 use File::Copy;
 use File::Path;
 use Cwd 'abs_path';
@@ -115,9 +115,29 @@ if ( @ARGV < 1 )
 	usage();
 }
 
-our $SHP2PGSQL = $TOP_BUILDDIR . "/loader/shp2pgsql";
-our $PGSQL2SHP = $TOP_BUILDDIR . "/loader/pgsql2shp";
-our $RASTER2PGSQL = $TOP_BUILDDIR . "/raster/loader/raster2pgsql";
+sub findOrDie
+{
+    my $exec = shift;
+    my $path = which $exec;
+	printf "Checking for %s ... ", $exec;
+    if ( defined($path) ) {
+		print "found ($path)\n";
+    }
+    else {
+		print "failed\n";
+		print STDERR "Unable to find $exec executable.\n";
+		print STDERR "PATH is " . $ENV{"PATH"} . "\n";
+		die "HINT: use POSTGIS_TOP_BUILD_DIR env or --build-dir switch the specify top build dir.\n";
+    };
+}
+
+# Prepend scripts' build dirs to path
+# TODO: make this conditional ?
+$ENV{PATH} = $TOP_BUILDDIR . '/loader:' . $TOP_BUILDDIR .  '/raster/loader:' . $ENV{PATH};
+
+our $SHP2PGSQL = findOrDie 'shp2pgsql';
+our $PGSQL2SHP = findOrDie 'pgsql2shp';
+our $RASTER2PGSQL = findOrDie 'raster2pgsql' if ( $OPT_WITH_RASTER );
 
 if ( $OPT_UPGRADE_PATH )
 {
@@ -168,41 +188,6 @@ my $STAGED_SCRIPTS_DIR = $STAGED_INSTALL_DIR . "/share/contrib/postgis";
 my $OBJ_COUNT_PRE = 0;
 my $OBJ_COUNT_POST = 0;
 
-##################################################################
-# Check that we have the executables we need
-##################################################################
-
-foreach my $exec ( ($SHP2PGSQL, $PGSQL2SHP) )
-{
-	printf "Checking for %s ... ", basename($exec);
-	if ( -x $exec )
-	{
-		print "found\n";
-	}
-	else
-	{
-		print "failed\n";
-		print STDERR "Unable to find $exec executable.\n";
-		print STDERR "TOP_BUILDDIR is ${TOP_BUILDDIR}\n";
-		die "HINT: use POSTGIS_TOP_BUILD_DIR env or --build-dir switch the specify top build dir.\n";
-	}
-
-}
-
-if ( $OPT_WITH_RASTER )
-{
-	print "Checking for raster2pgsql ... ";
-	if ( -x $RASTER2PGSQL )
-	{
-		print "found\n";
-	}
-	else
-	{
-		print "failed\n";
-		die "Unable to find raster2pgsql executable.\n";
-	}
-}
-
 ##################################################################
 # Set up the temporary directory
 ##################################################################
@@ -289,6 +274,16 @@ if ( ! $libver )
 	exit(1);
 }
 
+sub staged_scripts_dir
+{
+    unless ( -d $STAGED_SCRIPTS_DIR ) {
+        print STDERR "Unable to find $STAGED_SCRIPTS_DIR directory.\n";
+        print STDERR "TOP_BUILDDIR is $TOP_BUILDDIR.\n";
+        die "HINT: use POSTGIS_TOP_BUILD_DIR env or --build-dir switch the specify top build dir.\n";
+    }
+    $STAGED_SCRIPTS_DIR;
+}
+
 sub scriptdir
 {
 	my ( $version, $systemwide ) = @_;
@@ -300,7 +295,7 @@ sub scriptdir
 		chop $scriptdir;
 		$scriptdir .= "/contrib/postgis-" . $pgis_majmin;
 	} else {
-		$scriptdir = $STAGED_SCRIPTS_DIR;
+		$scriptdir = staged_scripts_dir()
 	}
 	#print "XXX: scriptdir: $scriptdir\n";
 	return $scriptdir;

-----------------------------------------------------------------------

Summary of changes:
 regress/run_test.pl | 75 +++++++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list