From f33acd31ac972c43c17f298d7671ae80ec9157a2 Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Fri, 28 Apr 2017 08:11:56 +0300 Subject: Fix apache2-maintscript-helper script, it requires maintainer action --- debian/postinst | 4 ++-- debian/prerm | 4 ++-- debian/scripts/httpd.sh | 28 +++++++++++++++++----------- 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'debian') 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. -- cgit v1.2.3