aboutsummaryrefslogtreecommitdiff
path: root/build/pgsql/configure
blob: 7eeadc99d4a5cbbf0ed38d8a78e2edcb5e8b76e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/env bash

# file      : build/pgsql/configure
# author    : Constantin Michael <constantin@codesynthesis.com>
# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
# license   : GNU GPL v2; see accompanying LICENSE file

#
# dcf_root - dynamic configuration root
#

$echo
$echo "Please enter the PostgreSQL client program path."
$echo

driver=`read_path --command psql`

$echo
$echo "Please enter the PostgreSQL database user. Note that the named"
$echo "user must be allowed to connect to the database server without"
$echo "specifying credentials."
$echo

user=`read_value "odb_test"`

$echo
$echo "Please enter the PostgreSQL database name. Note that it WILL BE"
$echo "MODIFIED by the tests."
$echo

db=`read_value "odb_test"`

$echo
$echo "Please enter the PostgreSQL database host."
$echo

host=`read_value ""`

$echo
$echo "Please enter the PostgreSQL database port or the socket file name"
$echo "extension for Unix-domain connections."
$echo

port=`read_value ""`

opt=$dcf_root/db.options
drv=$dcf_root/db-driver

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
echo "eval $scf_root/pgsql/pgsql --driver $driver \$opt \$*" >>$drv
chmod 755 $drv