summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Guriev <guriev-ns@ya.ru>2017-04-28 08:11:56 +0300
committerNicholas Guriev <guriev-ns@ya.ru>2017-04-28 08:11:56 +0300
commitf33acd31ac972c43c17f298d7671ae80ec9157a2 (patch)
treecd47133e5fcb5d075df15ab9a25f1febdf8da5b6
parent588535b3aee782df8ca56bd7cab10fa963baac50 (diff)
Fix apache2-maintscript-helper script, it requires maintainer action
-rwxr-xr-xdebian/postinst4
-rwxr-xr-xdebian/prerm4
-rw-r--r--debian/scripts/httpd.sh28
3 files changed, 21 insertions, 15 deletions
diff --git a/debian/postinst b/debian/postinst
index 01d99ac..3b114ce 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -165,8 +165,8 @@ configure|abort-upgrade)
# Try to enable web server configs (at most one is expected to succeed)
- try_chconf_apache2 "enable" dhelp || true
- try_chconf_lighttpd "enable" dhelp || true
+ try_chconf_apache2 "$1" enable dhelp || true
+ try_chconf_lighttpd "$1" enable dhelp || true
# Create the full text search index at the end of postinst.
diff --git a/debian/prerm b/debian/prerm
index 621a3c0..4597b9f 100755
--- a/debian/prerm
+++ b/debian/prerm
@@ -87,8 +87,8 @@ failed-upgrade)
*)
# Disable our web server configuration snippets.
- try_chconf_apache2 "disable" dhelp || true
- try_chconf_lighttpd "disable" dhelp || true
+ try_chconf_apache2 "$1" disable dhelp || true
+ try_chconf_lighttpd "$1" disable dhelp || true
# Cleanup the files installed by the postinst.
diff --git a/debian/scripts/httpd.sh b/debian/scripts/httpd.sh
index 1483ac7..09f6c7c 100644
--- a/debian/scripts/httpd.sh
+++ b/debian/scripts/httpd.sh
@@ -131,13 +131,15 @@ apache2_packaging ()
# Try to (en/dis)able an apache2 configuration snippet.
# Return error if (en/dis)abling tried and failed; caller *must* check status.
# ARGS:
-# $1={enable,disable} $2=package [$3=name_of_snippet_if_different_from_package]
+# $1=maintscript-action (configure,abort-upgrade)
+# $2={enable,disable} $3=package [$4=name_of_snippet_if_different_from_package]
#
try_chconf_apache2 ()
{
- local action=${1}
- local package=${2}
- local confname=${3}
+ local maintscript_action=${1}
+ local action=${2}
+ local package=${3}
+ local confname=${4}
local ret=0
_check_action_and_package ${action} ${package} "try_chconf_apache2" \
@@ -165,7 +167,7 @@ try_chconf_apache2 ()
local ahelper=/usr/share/apache2/apache2-maintscript-helper
if [ -e $ahelper ] ; then
- . $ahelper
+ . $ahelper $maintscript_action
apache2_invoke ${confaction} ${confname}.conf && ret=$? || ret=$?
if [ ${ret} -ne 0 ]; then
install_msg ${package} warning \
@@ -201,13 +203,15 @@ try_chconf_apache2 ()
# Try to (en/dis)able a lighttpd configuration snippet.
# Return error if (en/dis)abling tried and failed; caller *must* check status.
# ARGS:
-# $1={enable,disable} $2=package [$3=name_of_snippet_if_different_from_package]
+# $1=maintscript-action (configure,abort-upgrade), not used
+# $2={enable,disable} $3=package [$4=name_of_snippet_if_different_from_package]
#
try_chconf_lighttpd ()
{
- local action=${1}
- local package=${2}
- local confname=${3}
+ local maintscript_action=${1}
+ local action=${2}
+ local package=${3}
+ local snippetname=${4}
local ret=0
_check_action_and_package ${action} ${package} "try_chconf_lighttpd" \
@@ -227,8 +231,10 @@ try_chconf_lighttpd ()
return 0
fi
- if [ "X${confname}" = "X" ]; then
- confname=${package}
+ local confname=${package}
+
+ if [ "X${snippetname}" != "X" ]; then
+ confname=${snippetname}
fi
# lighty-xxx-mod will return 2 if no action is needed; workaround this.