[php-maint] Reboot Apache2 2.4 transition
Ondřej Surý
ondrej at debian.org
Tue May 7 10:02:24 UTC 2013
On Tue, May 7, 2013 at 11:08 AM, Arno Töll <arno at debian.org> wrote:
> Hi Ondřej,
>
> On 07.05.2013 10:05, Ondřej Surý wrote:
>> Will that get somemodule reenabled?
>
> No (unless our invoke code behaves buggy). We remember the state of a
> module in an internal state database so that we do not enable modules
> ever again, when it was disabled by the user (and not by a maintainer
> script, which is why maintainer scripts must not use a2enmod directly,
> or at least not without corresponding flags)
Cool!
>> (And why there's the "&& true" part?)
>
> This comes from the --conditional switch in dh_apache2. dh_apache2 can
> also be used by web applications and some of them may want to support
> various flavors of web servers, including those not being Apache.
I understand the conditional/error part - I am even using that in next
PHP upload. I was just referring to fact that '&& true' is ugly. I
guess that can be fixed by something like in the attached patch (take
it with a grain of salt, it's more than decade since I have touched
anything perly...)
> if [ "$1" = "configure" ] && [ -z $HAVE_APACHE ] ; then
> ...
>
> when called as dh_apache2 --conditional='[ -z $HAVE_APACHE ]'
That would not work because:
elsif ($dh{CONDITIONAL} !~ /^\w+$/) {
die "The conditional function name must only contain ASCII
letters, numbers, and underscores\n";
}
And the question is: "Could it work?"
Also there's some shell expansion happening somewhere in the Debhelper since:
dh_apache2 -Nphp5-cgi --conditional='[ "$(a2query -M)" != "prefork" ]'
generates:
# Automatically added by dh_apache2
if [ "$1" = "configure" ] && [ event != prefork ]; then
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
for conf in php5filter ; do
apache2_invoke enmod $conf || exit $?
done
fi
fi
# End automatically added section
Same with:
dh_apache2 -Nphp5-cgi --conditional='[ $MPM != "prefork" ]'
$MPM gets eaten:
# Automatically added by dh_apache2
if [ "$1" = "configure" ] && [ != prefork ]; then
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
for conf in php5filter ; do
apache2_invoke enmod $conf || exit $?
done
fi
fi
# End automatically added section
So you really need to have functions there.
Also it's quite unpleasant that you have to define the same (usually
dummy) function in postrm, but I can live with that.
One more thing – you are mentioning prerm in dh_apache2 documentation
couple of times, but not touching it at all (OPTIONS section).
O.
--
Ondřej Surý <ondrej at sury.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dh_apache2_no_true.patch
Type: application/octet-stream
Size: 1323 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20130507/67b15a77/attachment.obj>
More information about the pkg-php-maint
mailing list