Web lists-archives.com

Re: Versioned dependencies and maintainer scripts

On Sun, 24 Jun 2018 at 17:05:54 -0600, Daniele Nicolodi wrote:
> Packages that will use dh_installsystemduser will have maintainer
> scripts that will depend on the next relese of init-system-helpers.
> dh_installsystemduser will then inject a versioned dependency using the
> ${misc:Depends} substitution in debian/control.
> Is that enough to ensure that postinst and postrm maintainer scripts are
> run with the right version of init-system-helpers available?  Should I
> be using Pre-Depends instead?


For the postinst, you can rely on the updated init-system-helpers being
at least unpacked (which should be enough, because i-s-h is Essential,
so it's required to provide its core functionality while merely unpacked
and not yet configured).

The difference for Pre-Depends is that it would give you the ability to
assume that i-s-h has been configured (fully installed) before your
postinst runs. I don't think you need that here.

In the postrm, you can't normally rely on having your package's
dependencies still installed, but init-system-helpers is Essential so
it should still be there, and we don't officially support downgrades so
i-s-h should still be at least the required version.

Most packages do the more involved parts of their removal in the prerm.
Is that feasible here?