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

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



On Fri, Dec 26, 2008 at 11:01:24PM -0800, Russ Allbery wrote:
> > 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?

I agree with this.  While a dependency loop can cause a package's postinst
to be called before its dependencies are configured, dpkg always breaks such
dependency loops in favor of packages without a postinst, and adding a
Pre-Depends would not fix this anyway if the nature of the circular
dependency is that the other package also needs this package in its own
postinst.  So lintian should not generally be advising to use Pre-Depends
for an interpreter used in the postinst.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org


Reply to: