Use single quotes in preference to double quotes for protecting pathnames.

Per recommendation from Peter.  Neither choice is bulletproof, but this
is the existing style and it does help prevent unexpected environment
variable substitution.
This commit is contained in:
Tom Lane 2011-06-15 21:45:23 -04:00
parent e1ccaff6ee
commit 1568fa75bc
6 changed files with 19 additions and 19 deletions

View File

@ -263,7 +263,7 @@ X = @EXEEXT@
ifneq (@PERL@,) ifneq (@PERL@,)
# quoted to protect pathname with spaces # quoted to protect pathname with spaces
PERL = "@PERL@" PERL = '@PERL@'
else else
PERL = $(missing) perl PERL = $(missing) perl
endif endif
@ -437,7 +437,7 @@ endif
pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE) pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir) $(pg_regress_locale_flags) pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir) $(pg_regress_locale_flags)
pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir="$(PSQLDIR)" $(pg_regress_locale_flags) pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir='$(PSQLDIR)' $(pg_regress_locale_flags)
pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ log/ pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ log/

View File

@ -130,7 +130,7 @@ ifeq ($(PORTNAME), darwin)
ifneq ($(SO_MAJOR_VERSION), 0) ifneq ($(SO_MAJOR_VERSION), 0)
version_link = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) version_link = -compatibility_version $(SO_MAJOR_VERSION) -current_version $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
endif endif
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
shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX) shlib = lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX) shlib_major = lib$(NAME).$(SO_MAJOR_VERSION)$(DLSUFFIX)
else else

View File

@ -164,27 +164,27 @@ utils/probes.h: utils/probes.d
# For headers generated during regular builds, we prefer a relative symlink. # For headers generated during regular builds, we prefer a relative symlink.
$(top_builddir)/src/include/parser/gram.h: parser/gram.h $(top_builddir)/src/include/parser/gram.h: parser/gram.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \ prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \ cd '$(dir $@)' && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" . $(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h $(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \ prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \ cd '$(dir $@)' && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" . $(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/utils/errcodes.h: utils/errcodes.h $(top_builddir)/src/include/utils/errcodes.h: utils/errcodes.h
cd $(dir $@) && rm -f $(notdir $@) && \ cd '$(dir $@)' && rm -f $(notdir $@) && \
$(LN_S) ../../../$(subdir)/utils/errcodes.h . $(LN_S) "../../../$(subdir)/utils/errcodes.h" .
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h $(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \ prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \ cd '$(dir $@)' && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" . $(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/utils/probes.h: utils/probes.h $(top_builddir)/src/include/utils/probes.h: utils/probes.h
cd $(dir $@) && rm -f $(notdir $@) && \ cd '$(dir $@)' && rm -f $(notdir $@) && \
$(LN_S) ../../../$(subdir)/utils/probes.h . $(LN_S) "../../../$(subdir)/utils/probes.h" .
utils/probes.o: utils/probes.d $(SUBDIROBJS) utils/probes.o: utils/probes.d $(SUBDIROBJS)

View File

@ -5,8 +5,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
override CPPFLAGS := \ override CPPFLAGS := \
-I$(top_builddir)/src/port \ '-I$(top_builddir)/src/port' \
-I$(top_srcdir)/src/test/regress \ '-I$(top_srcdir)/src/test/regress' \
'-DHOST_TUPLE="$(host_tuple)"' \ '-DHOST_TUPLE="$(host_tuple)"' \
'-DMAKEPROG="$(MAKE)"' \ '-DMAKEPROG="$(MAKE)"' \
'-DSHELLPROG="$(SHELL)"' \ '-DSHELLPROG="$(SHELL)"' \
@ -84,4 +84,4 @@ checktcp: all
./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost
installcheck: all installcheck: all
./pg_regress --psqldir="$(PSQLDIR)" --dbname=regress1,connectdb --top-builddir=$(top_builddir) $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb ./pg_regress --psqldir='$(PSQLDIR)' --dbname=regress1,connectdb --top-builddir=$(top_builddir) $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb

View File

@ -9,9 +9,9 @@ AROPT = crs
libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
ifeq ($(host_os), aix3.2.5) ifeq ($(host_os), aix3.2.5)
rpath = -L$(rpathdir) rpath = -L'$(rpathdir)'
else else
rpath = -Wl,-blibpath:$(rpathdir)$(libpath) rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
endif endif
DLSUFFIX = .so DLSUFFIX = .so

View File

@ -73,7 +73,7 @@ maintainer-clean: distclean
rm -f specparse.c specscanner.c rm -f specparse.c specscanner.c
installcheck: all installcheck: all
./pg_isolation_regress --psqldir="$(PSQLDIR)" --inputdir=$(srcdir) --schedule=$(srcdir)/isolation_schedule ./pg_isolation_regress --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --schedule=$(srcdir)/isolation_schedule
# We can't support "make check" because isolationtester requires libpq, and # We can't support "make check" because isolationtester requires libpq, and
# in fact (on typical platforms using shared libraries) requires libpq to # in fact (on typical platforms using shared libraries) requires libpq to