[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#508307: wrong interpreter-without-predep



Policy folks,

The question here is about Lintian's check interpreter-without-predep,
which requires that any package that uses a non-base interpreter for any
maintainer script declare a pre-dependency, not just a dependency, on that
interpreter.

The current description of that tag says:

Info: The package contains a control script that uses an unusual
 interpreter, but does not declare a pre-dependency on the package that
 provides this interpreter.
 .
 A perusal of &packaging; section 6.2 shows that any of the control
 scripts can be called while the package is not configured.  Therefore, a
 pre-dependency is required to ensure that the interpreter is always
 available when the script is invoked.
 .
 Please do not add a pre-dependency without following the policy for doing
 so. (Policy section 3.5).

"Adam D. Barratt" <adam@adam-barratt.org.uk> writes:

> It might seem like Lintian is being overly picky here, as in the normal
> case one can safely assume that dependencies are present when the
> postinst is called, but there are cases where this is not true - where
> there is a dependency loop between the packages and both have postinsts,
> there is no guarantee as to which order the postinsts will be executed
> in. Since Lintian checks packages in isolation, it has no way of knowing
> whether such a loop exists (and of course a loop could be later
> introduced by another package).

I reviewed the section on maintainer scripts, and while preinst certainly
requires a Pre-Depends for any non-base interpreter and postrm can't use a
non-base interpreter at all (due to purge), I think dependency loop
breakage is the only case when postinst or prerm scripts can be called
without all dependencies being configured.

Given that, I think Lintian may be too conservative here.  Dependency
loops are an issue, but they're also rare and maintainers should have some
idea that they might exist.  When they exist, I think they can be treated
as normal bugs.  Adding Pre-Depends due to the possibility of loops
showing up someday seems like a bad idea.  Asking everyone to use standard
interpreters for maintainer scripts sounds like a better idea, but there's
a separate Lintian tag for that anyway which reflects it's not a
requirement.

Given that, my inclination here is to modify Lintian to ban unusual
interpreters for postrm scripts, require Pre-Depends for preinst scripts,
and only require Depends for postinst and prerm scripts.  However, I'd
like to have that checked by other people on the debian-policy list,
particularly those here who also work on dpkg.  Is my analysis correct?

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: