Don't say 'export PGHOST' or 'export PGPORT' unless we actually define

those variables.  Some shells will invent an empty-string definition in
this case, which is not what we want.
This commit is contained in:
Tom Lane 2000-12-31 18:38:44 +00:00
parent e41b8a0fdd
commit 52522850fe

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.14 2000/12/11 19:00:33 tgl Exp $ # $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.15 2000/12/31 18:38:44 tgl Exp $
me=`basename $0` me=`basename $0`
: ${TMPDIR=/tmp} : ${TMPDIR=/tmp}
@ -89,9 +89,6 @@ unset top_builddir
unset temp_install unset temp_install
unset multibyte unset multibyte
export PGHOST
export PGPORT
dbname=regression dbname=regression
hostname=localhost hostname=localhost
@ -138,9 +135,11 @@ do
shift;; shift;;
--host=*) --host=*)
PGHOST=`expr "x$1" : "x--host=\(.*\)"` PGHOST=`expr "x$1" : "x--host=\(.*\)"`
export PGHOST
shift;; shift;;
--port=*) --port=*)
PGPORT=`expr "x$1" : "x--port=\(.*\)"` PGPORT=`expr "x$1" : "x--port=\(.*\)"`
export PGPORT
shift;; shift;;
--user=*) --user=*)
PGUSER=`expr "x$1" : "x--user=\(.*\)"` PGUSER=`expr "x$1" : "x--user=\(.*\)"`
@ -276,10 +275,12 @@ then
PGDATA=$temp_install/data PGDATA=$temp_install/data
if [ "$unix_sockets" = no ]; then if [ "$unix_sockets" = no ]; then
PGHOST=$hostname PGHOST=$hostname
export PGHOST
else else
unset PGHOST unset PGHOST
fi fi
PGPORT=65432 PGPORT=65432
export PGPORT
# ---------- # ----------
# Set up shared library paths, needed by psql and pg_encoding # Set up shared library paths, needed by psql and pg_encoding
@ -357,7 +358,10 @@ then
else # not temp-install else # not temp-install
# If Unix sockets are not available, use the local host by default. # If Unix sockets are not available, use the local host by default.
[ "$unix_sockets" = no ] && ${PGHOST=$hostname} if [ "$unix_sockets" = no ]; then
PGHOST=$hostname
export PGHOST
fi
if [ -n "$PGPORT" ]; then if [ -n "$PGPORT" ]; then
port_info="port $PGPORT" port_info="port $PGPORT"