File: php4-pgsql.postinst

package info (click to toggle)
php4-pgsql 3%3A4.3.10-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,776 kB
  • ctags: 349
  • sloc: sh: 8,442; ansic: 3,831; makefile: 70; awk: 70; php: 64
file content (43 lines) | stat: -rw-r--r-- 1,089 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
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule

#DEBHELPER#

if [ "$1" != "configure" ]; then
	exit 0
fi

EXTENSIONRE="^[[:space:]]*extension[[:space:]]*=[[:space:]]*pgsql\.so"
IMAPRE="^[[:space:]]*extension[[:space:]]*=[[:space:]]*imap\.so"

for SAPI in apache cgi apache2 cli
do
	if [ -f /etc/php4/$SAPI/php.ini ]; then
		db_get php4/extension_pgsql_$SAPI
		if [ "$RET" = "true" ] \
		   && ! grep -q "$EXTENSIONRE" /etc/php4/$SAPI/php.ini
		then
			echo "extension=pgsql.so" >> /etc/php4/$SAPI/php.ini
		fi
		if [ -f "/etc/php4/$SAPI/php.ini" ] \
		   && grep -q "$IMAPRE" /etc/php4/$SAPI/php.ini
		then
			grep -v "$IMAPRE" < /etc/php4/$SAPI/php.ini \
				> /etc/php4/$SAPI/php.ini.pgsqlbeforeimap
			echo "extension=imap.so" \
				>> /etc/php4/$SAPI/php.ini.pgsqlbeforeimap
			chown --reference=/etc/php4/$SAPI/php.ini \
				/etc/php4/$SAPI/php.ini.pgsqlbeforeimap
			chmod --reference=/etc/php4/$SAPI/php.ini \
				/etc/php4/$SAPI/php.ini.pgsqlbeforeimap
			mv /etc/php4/$SAPI/php.ini.pgsqlbeforeimap \
				/etc/php4/$SAPI/php.ini
		fi
	fi
done

exit 0