File: postgresql-client.postinst

package info (click to toggle)
postgresql 7.2.1-2woody8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 42,424 kB
  • ctags: 30,027
  • sloc: ansic: 290,568; java: 18,529; sh: 12,197; sql: 11,401; yacc: 11,189; tcl: 8,063; perl: 4,067; makefile: 3,332; xml: 2,874; lex: 2,799; python: 1,237; cpp: 845; pascal: 81; asm: 70; awk: 20; sed: 8
file content (51 lines) | stat: -rw-r--r-- 1,312 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
#! /bin/bash

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" ]
then
        if [ -d /usr/doc -a ! -e /usr/doc/postgresql-client -a -d /usr/share/doc/postgresql-client ]
	then
                ln -sf ../share/doc/postgresql-client /usr/doc/postgresql-client
        fi
# If any conffiles have been _deleted_, restore them from the dpkg-dist
# versions (deletion goes beyond valid user editing!)
for f in /etc/postgresql/postgresql.env
do
	if [ ! -f $f ]
	then
		echo Trying to restore missing $f
		[ -f $f.dpkg-dist ] && mv $f.dpkg-dist $f
		if [ ! -f $f ]
		then
			echo "$f is missing; may I create a new copy? [Y/n]"
			read x
			[ -z "$x" ] && x=y
			case $x in
				y | Y | yes | YES | Yes)
					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=

export PGLIB PGDATA PGACCESS_HOME PGHOST
EOI
					;;
				*)
					echo "You need to create $f before postgresql-client will
work properly"
			esac
		fi
	fi
done
fi

#DEBHELPER#