File: postgresql-client.postinst

package info (click to toggle)
postgresql 7.4.7-6sarge6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,168 kB
  • ctags: 27
  • sloc: sh: 1,903; makefile: 337; ansic: 204; perl: 69; sed: 6; tcl: 1
file content (54 lines) | stat: -rw-r--r-- 1,589 bytes parent folder | download
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
#! /bin/bash
set -e

# Load the debconf library - this must come FIRST; do not insert any other
# commands before this
. /usr/share/debconf/confmodule

# echo
# echo The file /etc/postgresql/postgresql.env provides the normal set-up for
# echo an ordinary user running PostgreSQL.  It is automatically read by the
# echo wrapper script for PostgreSQL user commands in postgresql-client.
# echo

if [ "$1" = "configure" -o "$1" = "reconfigure" ]
then
# If the conffile has been _deleted_, restore it from the dpkg-dist
# version (deletion goes beyond valid user editing!)
    f=/etc/postgresql/postgresql.env
    if [ ! -f $f ]
    then
	# postgresql.env has been deleted; we must have it, but since
	# it is a conffile, we must ask
	MAILSUBJECT="postgresql-client - postgresql.env missing"
	db_get postgresql-client/missing-postgresql.env
	if [ "$RET" = true ]
	then
	    # echo Trying to restore missing $f
	    [ -f $f.dpkg-dist ] && mv $f.dpkg-dist $f || true
	    if [ ! -f $f ]
	    then
                cat >$f <<EOI
[ -r /etc/postgresql/postmaster.conf ] &&
	. /etc/postgresql/postmaster.conf

PGDATA=${POSTGRES_DATA:-/var/lib/postgres/data}
PGLIB=/usr/lib/postgresql/lib
PGACCESS_HOME=/usr/lib/postgresql/share/pgaccess
PGHOST=
PGPORT=5432

export PGLIB PGDATA PGACCESS_HOME PGHOST PGPORT
EOI
            fi
	else
	    echo "/etc/postgresql/postgresql.env is needed by the package postgresql-client.
It is missing, and you have not allowed the installation scripts to recreate it.

You must recreate it before postgresql-client will work properly.
" >&2
	fi
    fi
fi

#DEBHELPER#