Bug#741350: a2enconf confusion - .conf extension?
-----BEGIN PGP SIGNED MESSAGE-----
On 14/03/14 18:53, Jean-Michel Vourgère wrote:
> Hello Daniel
> Just a few hints:
> On Friday 14 March 2014 08:35:55 Daniel Pocock wrote:
>> a) if my postinst or postrm calls apache2_invoke from inside a
>> function, then it fails badly
>> b) some of my postinst and postrm code is based on examples I saw
>> in other packages, they test -x /usr/sbin/apache2 and it turns
>> out this is not a great idea as if somebody does
>> dpkg --remove apache2 loganalyzer dpkg --purge loganalyzer
>> then at the moment the loganalyzer postrm runs with the "purge"
>> argument, there is no /usr/sbin/apache2 and so it does not remove
>> the symlink
>> Also, the check for /usr/share/apache2/apache2-maintscript-helper
>> would also fail if apache2 had been removed - it is OK for the
>> postrm to just proceed without calling apache2_invoke at all if
>> it is no longer there or should the postm complain?
> Please have another look at the wiki: "apache2_invoke disconf" must
> be called both at purge *and* at simple removal. So that should
> take care of your question b.
> Actually, source apache2-maintscript-helper is using the scripts
> arguments - like "postrm purge" - in oder to know what it should
> do. So it must be called from the script top level, and not from a
> function where that environment changed.
> If you really need to call the helpers from a function, I guess you
> need if [ -e /usr/share/apache2/apache2-maintscript-helper ] ;
> then . /usr/share/apache2/apache2-maintscript-helper fi at top
> level, where $1 == 'configure' or whatever. Then you should be able
> to call apache2_invoke from a function, providing you wrap it in a
> [ -e /usr/share/apache2/apache2-maintscript-helper ] too of course.
> I did not test that.
> Regarding your question b again, if you try dh_apache2, you'll see
> that deconfiguration is done at prerm time too, so that
> simultaneous removal of apache and your package should work, no
> matter the order in wich it occurs. And the bonus: If there's a bug
> in (pre|post)(inst|rm), you have someone else to blame, isn't that
> nice? ;-)
> -- Nirgal
Almost - while that sounds good (making the helper script do
everything), I am also trying to ensure my package is suitable for
wheezy-backports so I've used slightly more verbose scripting as shown
in the bottom of the wiki page:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
-----END PGP SIGNATURE-----