diff options
| author | sean finney <seanius@debian.org> | 2006-10-28 14:29:44 +0200 |
|---|---|---|
| committer | Sean Finney <seanius@debian.org> | 2009-04-10 13:14:58 +0200 |
| commit | fe35193e44789fa17e5eafad3a76bf71a40570cc (patch) | |
| tree | b75d4c10bd2c6a113c93ea03d5c551e51be14b6d /debian/php5-module.postinst | |
| parent | 98c09b2ce846f6bdaf0adbf66fffd9f7d58b5d33 (diff) | |
| download | php-fe35193e44789fa17e5eafad3a76bf71a40570cc.tar.gz | |
Imported Debian patch 5.1.6-5debian/5.1.6-5
Diffstat (limited to 'debian/php5-module.postinst')
| -rw-r--r-- | debian/php5-module.postinst | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/debian/php5-module.postinst b/debian/php5-module.postinst index 5244d6dc1..9aef9e14a 100644 --- a/debian/php5-module.postinst +++ b/debian/php5-module.postinst @@ -2,25 +2,31 @@ set -e -# Source debconf library. -. /usr/share/debconf/confmodule - -#DEBHELPER# - if [ "$1" != "configure" ]; then exit 0 fi -for SAPI in apache apache2 cgi cli -do - if [ -f /etc/php5/$SAPI/php.ini ]; then - db_get php5/extension_@dsoname@_$SAPI - if [ "$RET" = "true" ] \ - && ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*@dsoname@\.so" /etc/php5/$SAPI/php.ini - then - echo "extension=@dsoname@.so" >> /etc/php5/$SAPI/php.ini +# here we test for upgrades from versions prior to the config-file-scan-dir +# migration. +# +# to avoid lots of scary warnings about duplicate-loaded modules, each +# module will remove its "extension=" line from each SAPI's php.ini file +# when upgrading from a "prior version". this will be the last time we +# ever muck with such files in maintainer scripts. really. promise :) + +if [ "$2" ] && dpkg --compare-versions "$2" lt "5.1.6-5"; then + extension_re='^[[:space:]]*extension[[:space:]]*=[[:space:]]*@dsoname@\.so$' + for SAPI in apache apache2 cgi cli; do + ini_file="/etc/php5/$SAPI/php.ini" + if [ -f "$ini_file" ]; then + if grep -q "$extension_re" $ini_file; then + sed -i -e "/$extension_re/d" $ini_file + fi fi - fi -done + done +fi + +#DEBHELPER# exit 0 + |
