From: Tom Lane Date: Tue, 14 Jun 2011 20:24:45 +0000 (-0400) Subject: Fix assorted issues with build and install paths containing spaces. X-Git-Tag: REL8_3_16~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb5226e02a7cb336dbc17782d8788b178359826e;p=postgresql Fix assorted issues with build and install paths containing spaces. Apparently there is no buildfarm critter exercising this case after all, because it fails in several places. With this patch, build, install, check-world, and installcheck-world pass for me on OS X. --- diff --git a/config/mkinstalldirs b/config/mkinstalldirs index 070b418022..d7b533bcce 100755 --- a/config/mkinstalldirs +++ b/config/mkinstalldirs @@ -105,13 +105,15 @@ esac for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + # pathcomp starts with leading slash if present, else empty + pathcomp=`echo "$file" | sed -ne 's|^\(.\).*$|\1|;s|[^/]||;p'` + # swap spaces and slashes, then split on spaces + set fnord `echo "$file" | tr ' /' '/ '` shift - pathcomp= for d do - pathcomp="$pathcomp$d" + pathcomp="$pathcomp"`echo "$d" | tr '/' ' '` case $pathcomp in -*) pathcomp=./$pathcomp ;; esac diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 4f897f4eff..84fc91869a 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -107,7 +107,7 @@ ifeq ($(PORTNAME), darwin) ifeq ($(DLTYPE), library) # linkable library DLSUFFIX = .dylib - LINK.shared = $(COMPILER) -dynamiclib -install_name $(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) $(version_link) $(exported_symbols_list) -multiply_defined suppress + LINK.shared = $(COMPILER) -dynamiclib -install_name "$(libdir)/lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)" $(version_link) $(exported_symbols_list) -multiply_defined suppress else # loadable module (default case) DLSUFFIX = .so diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile index bac7783f2c..75d4647cba 100644 --- a/src/interfaces/ecpg/test/Makefile +++ b/src/interfaces/ecpg/test/Makefile @@ -95,4 +95,4 @@ checktcp: all ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost installcheck: all - ./pg_regress --psqldir=$(PSQLDIR) --dbname=regress1,connectdb --top-builddir=$(top_builddir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb + ./pg_regress --psqldir="$(PSQLDIR)" --dbname=regress1,connectdb --top-builddir=$(top_builddir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 1663c9d232..331e32d9a2 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -255,7 +255,7 @@ endif # against installed postmaster installcheck: submake - $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS) + $(top_builddir)/src/test/regress/pg_regress --psqldir="$(PSQLDIR)" $(REGRESS_OPTS) $(REGRESS) # in-tree test doesn't work yet (no way to install my shared library) #check: all submake diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index 5622b45ec1..bbb35aec98 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -103,7 +103,7 @@ uninstall: rm -f '$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)' installcheck: submake - $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS) + $(top_builddir)/src/test/regress/pg_regress --psqldir="$(PSQLDIR)" $(REGRESS_OPTS) $(REGRESS) .PHONY: submake submake: diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 0b52c3d238..6155f63c26 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -105,7 +105,7 @@ uninstall: rm -f '$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)' installcheck: submake - $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS) + $(top_builddir)/src/test/regress/pg_regress --psqldir="$(PSQLDIR)" $(REGRESS_OPTS) $(REGRESS) .PHONY: submake submake: diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index 6fc6cc272f..29905d0266 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -92,7 +92,7 @@ uninstall: $(MAKE) -C modules $@ installcheck: submake - $(top_builddir)/src/test/regress/pg_regress --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS) + $(top_builddir)/src/test/regress/pg_regress --psqldir="$(PSQLDIR)" $(REGRESS_OPTS) $(REGRESS) .PHONY: submake submake: diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile index 4d19f9c0bb..da117dcb83 100644 --- a/src/test/regress/GNUmakefile +++ b/src/test/regress/GNUmakefile @@ -98,7 +98,7 @@ ofile_list := $(subst .source,, $(notdir $(wildcard $(top_srcdir)/$(subdir)/outp output_files := $(foreach file, $(ofile_list), expected/$(file).out) ifneq ($(PORTNAME),win32) -abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_srcdir := $(shell cd "$(srcdir)" && pwd) abs_builddir := $(shell pwd) else abs_srcdir := $(shell cd $(srcdir) && pwd -W) @@ -141,13 +141,13 @@ tablespace-setup: ## check: all - ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF) + ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir="$(abs_srcdir)" --temp-port=$(TEMP_PORT) --schedule="$(srcdir)"/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) $(TEMP_CONF) installcheck: all - ./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) + ./pg_regress --psqldir="$(PSQLDIR)" --schedule="$(srcdir)"/serial_schedule --srcdir="$(abs_srcdir)" --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) installcheck-parallel: all - ./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) + ./pg_regress --psqldir="$(PSQLDIR)" --schedule="$(srcdir)"/parallel_schedule --srcdir="$(abs_srcdir)" --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) # old interfaces follow... @@ -157,10 +157,10 @@ runtest: installcheck runtest-parallel: installcheck-parallel bigtest: all - ./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big + ./pg_regress --psqldir="$(PSQLDIR)" --schedule="$(srcdir)"/serial_schedule --srcdir="$(abs_srcdir)" --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big bigcheck: all - ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) numeric_big + ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir="$(abs_srcdir)" --temp-port=$(TEMP_PORT) --schedule="$(srcdir)"/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) numeric_big ##