summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-07-15 09:12:19 +0200
committerOndřej Surý <ondrej@sury.org>2013-07-15 09:16:34 +0200
commit6bb7b2b3a587b46296bb44fe8d145643d1537e93 (patch)
tree6d2c869aaf9943727839d9703dc03acb83a4a7a3 /debian
parentf8eb1f7fefd882219d670fea27dfae7d8964c7d5 (diff)
downloadphp-6bb7b2b3a587b46296bb44fe8d145643d1537e93.tar.gz
Re-create (and re-remove) conf.d symlinks when module is already enabled (disabled) (Closes: #716893)
Diffstat (limited to 'debian')
-rw-r--r--debian/debhelper/php5-maintscript-helper3
-rw-r--r--debian/php5enmod17
2 files changed, 13 insertions, 7 deletions
diff --git a/debian/debhelper/php5-maintscript-helper b/debian/debhelper/php5-maintscript-helper
index c827a5f2a..5c6663f41 100644
--- a/debian/debhelper/php5-maintscript-helper
+++ b/debian/debhelper/php5-maintscript-helper
@@ -220,6 +220,7 @@ php5_invoke()
php5query -s "$SAPI" -m "$MOD" > /dev/null 2>&1 || php5query_ret=$?
if [ "$php5query_ret" -eq 0 ] ; then
# configuration is already enabled
+ php5$CMD -m -s "$SAPI" -q "$MOD" > /dev/null 2>&1 || return 1
php5_msg "info" "php5_invoke $MOD: already enabled for $SAPI SAPI"
PHP5_NEED_ACTION=1
elif [ "$php5query_ret" -eq 32 ] ; then
@@ -231,7 +232,7 @@ php5_invoke()
# a) we have no clue about the module (e.g. for upgrades prior to maintscript-helper
# b) it's a fresh install
PHP5_NEED_ACTION=1
- php5$CMD -m -s "$SAPI" -q "$MOD" > /dev/null 2>&1 || return 1
+ php5$CMD -m -s "$SAPI" -q "$MOD" > /dev/null 2>&1 || return 1
php5_msg "info" "php5_invoke: Enable module $MOD for $SAPI SAPI"
fi
;;
diff --git a/debian/php5enmod b/debian/php5enmod
index 393bc9371..f720e5a75 100644
--- a/debian/php5enmod
+++ b/debian/php5enmod
@@ -120,9 +120,8 @@ enmod() {
php5query -q -s $sapi -m $modname || module_state=$?
case $module_state in
- # module enabled
+ # module enabled, but re-enable the conf.d link just in case
0)
- return 0
;;
# module not yet enabled
1)
@@ -152,7 +151,12 @@ enmod() {
esac
if [ -d "/etc/php5/$sapi/conf.d" ]; then
- ln -s "${live_link_content}" "${live_link}"
+ if [ ! -h "${live_link}" ]; then
+ ln -s "${live_link_content}" "${live_link}"
+ fi
+ else
+ warning "Directory /etc/php5/$sapi/conf.d doesn't exist, not enabling the module"
+ return 1
fi
return 0
@@ -183,9 +187,8 @@ dismod() {
# module enabled
0)
;;
- # module not enabled
+ # module not enabled, but re-remove the link just in case
1|32|33)
- return 0
;;
34)
warning "Not disabling module $modname for $sapi SAPI. The configuration was"
@@ -200,7 +203,9 @@ dismod() {
esac
if [ -d "/etc/php5/$sapi/conf.d" ]; then
- rm -f $live_link
+ if [ -h "$live_link" ]; then
+ rm -f "$live_link"
+ fi
fi
return 0