]> granicus.if.org Git - postgis/commitdiff
Apply fix to allow regression tests to run on MingW by fixing PATH and removing trail...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 18 Jul 2009 18:55:26 +0000 (18:55 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 18 Jul 2009 18:55:26 +0000 (18:55 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/1.4@4320 b70326c6-7e19-0410-871a-916f4a2858ee

regress/Makefile.in
regress/run_test

index 60080404fdd50ee3a7cb7c40c095ebac01a99d2e..33ab6061ce18f0552db54c3bca2b3838cd760f24 100644 (file)
@@ -3,12 +3,17 @@ TMPDIR?=/tmp
 POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
 POSTGIS_GEOS_VERSION=@POSTGIS_GEOS_VERSION@
 POSTGIS_PROJ_VERSION=@POSTGIS_PROJ_VERSION@
-PGSQL_BINDIR=@PGSQL_BINDIR@
+
+# MingW hack: rather than use PGSQL_BINDIR directly, we change
+# to the directory and then use "pwd" to return the path. This
+# ensures that the returned path is in MSYS format, otherwise
+# colons in drive letters will break PATH.
+PGSQL_BINDIR=$(shell pushd "@PGSQL_BINDIR@" && pwd && popd)
 
 # 
 # Put path from pg_config into front of search path
 #
-PATH := $(PGSQL_BINDIR):$(PATH)
+PATH := "$(PGSQL_BINDIR):$(PATH)"
 export PATH
 
 
index ed6de36532753f622129926eafbafe9bf329bb37..ffd528bf50a99706476237b0f27e686971341f34 100755 (executable)
@@ -181,7 +181,8 @@ run_loader_test ()
 
        show_progress
 
-       if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}"` -gt 0 ]; then
+       # MingW hack: use tr to strip off any trailing CR/LFs introduce by MingW which confuse expr
+       if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}" | tr -d '\r\n'` -gt 0 ]; then
                ${PSQL} -c "DROP TABLE ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1
        fi