aboutsummaryrefslogtreecommitdiff
path: root/build/pgsql
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-07-14 13:38:50 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-07-14 17:08:11 +0200
commit65482585a1cb714bb90592b5aecc31e3fe260e43 (patch)
treef31ee59fa60d17b1fad865da79847a06ecacd5f9 /build/pgsql
parente47e91e08a890cc0ac727985ba9352a579345ace (diff)
Do not output empty PostgreSQL client configuration options
Diffstat (limited to 'build/pgsql')
-rwxr-xr-xbuild/pgsql/configure19
1 files changed, 12 insertions, 7 deletions
diff --git a/build/pgsql/configure b/build/pgsql/configure
index 11f419e..7eeadc9 100755
--- a/build/pgsql/configure
+++ b/build/pgsql/configure
@@ -31,9 +31,8 @@ $echo
db=`read_value "odb_test"`
$echo
-$echo "Please enter the PostgreSQL database host. Leaving this field"
-$echo "blank results in using Unix-domain socket. Machines without"
-$echo "Unix-domain sockets will connect to localhost."
+$echo "Please enter the PostgreSQL database host."
+$echo
host=`read_value ""`
@@ -47,10 +46,16 @@ port=`read_value ""`
opt=$dcf_root/db.options
drv=$dcf_root/db-driver
-echo "--user '$user'" >$opt
-echo "--database '$db'" >>$opt
-echo "--host '$host'" >>$opt
-echo "--port '$port'" >>$opt
+echo "--user '$user'" >$opt
+echo "--database '$db'" >>$opt
+
+if [ -n "$host"]; then
+echo "--host '$host'" >>$opt
+fi
+
+if [ -n "$port"]; then
+echo "--port '$port'" >>$opt
+fi
echo "#!/bin/sh" >$drv
echo "opt=\`cat $opt\`" >>$drv