File: php4-pgsql.prerm

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 (44 lines) | stat: -rw-r--r-- 1,114 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
#!/bin/sh

set -e

#DEBHELPER#

if [ "$1" != "remove" -a "$1" != "purge" ]; then
	exit 0
fi

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

. /usr/share/debconf/confmodule

for SAPI in apache cgi apache2 cli
do
	# Use the same question for all extensions, because it's only
	# used once per package: right here.
	if [ -f "/etc/php4/$SAPI/php.ini" ] \
	   && grep -q "$EXTENSIONRE" /etc/php4/$SAPI/php.ini
	then
		db_set php4/remove_extension true
		db_title "PHP"
		db_subst php4/remove_extension extname PostgreSQL
		db_subst php4/remove_extension sapiconfig $SAPI
		db_input low php4/remove_extension || true
		db_go

		db_get php4/remove_extension
		if [ "$RET" = "true" ]; then
			grep -v "$EXTENSIONRE" < /etc/php4/$SAPI/php.ini \
				> /etc/php4/$SAPI/php.ini.pgsqlremove
			chown --reference=/etc/php4/$SAPI/php.ini \
				/etc/php4/$SAPI/php.ini.pgsqlremove
			chmod --reference=/etc/php4/$SAPI/php.ini \
				/etc/php4/$SAPI/php.ini.pgsqlremove
			mv /etc/php4/$SAPI/php.ini.pgsqlremove \
				/etc/php4/$SAPI/php.ini
		fi
		db_fset php4/remove_extension seen false
	fi
done

exit 0