~l3on/ubuntu/trusty/php-mcrypt/fix-1243568

« back to all changes in this revision

Viewing changes to debian/php4-mcrypt.prerm

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2006-03-22 15:10:44 UTC
  • Revision ID: james.westby@ubuntu.com-20060322151044-baodv64rtms0e5fq
Tags: 5.1.2-1
* Initial release. (Closes: #321933)
* Use 3.01 version of PHP license.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
#DEBHELPER#
 
6
 
 
7
if [ "$1" != "remove" ] && [ "$1" != "purge" ]; then
 
8
        exit 0
 
9
fi
 
10
 
 
11
EXTENSIONRE="^[[:space:]]*extension[[:space:]]*=[[:space:]]*mcrypt\.so"
 
12
 
 
13
. /usr/share/debconf/confmodule
 
14
 
 
15
for SAPI in apache cgi apache2 cli
 
16
do
 
17
        # Use the same question for all extensions, because it's only
 
18
        # used once per package: right here.
 
19
        if [ -f "/etc/php4/$SAPI/php.ini" ] \
 
20
           && grep -q "$EXTENSIONRE" /etc/php4/$SAPI/php.ini
 
21
        then
 
22
                db_set php4/remove_extension true
 
23
                db_title "PHP"
 
24
                db_subst php4/remove_extension extname MCrypt
 
25
                db_subst php4/remove_extension sapiconfig $SAPI
 
26
                db_input low php4/remove_extension || true
 
27
                db_go
 
28
 
 
29
                db_get php4/remove_extension
 
30
                if [ "$RET" = "true" ]; then
 
31
                        grep -v "$EXTENSIONRE" < /etc/php4/$SAPI/php.ini \
 
32
                                > /etc/php4/$SAPI/php.ini.mcryptremove
 
33
                        chown --reference=/etc/php4/$SAPI/php.ini \
 
34
                                /etc/php4/$SAPI/php.ini.mcryptremove
 
35
                        chmod --reference=/etc/php4/$SAPI/php.ini \
 
36
                                /etc/php4/$SAPI/php.ini.mcryptremove
 
37
                        mv /etc/php4/$SAPI/php.ini.mcryptremove \
 
38
                                /etc/php4/$SAPI/php.ini
 
39
                fi
 
40
                db_fset php4/remove_extension seen false
 
41
        fi
 
42
done
 
43
 
 
44
exit 0