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

Bug#495954: [Pkg-openldap-devel] Bug#495954: slapd: Upgrade to Lenny failed: libldap_r-2.3.so.0 missing



On Sat, Aug 23, 2008 at 10:43:17PM +0200, Sven Joachim wrote:
> > Well, it's an aptitude bug, so doing so.  The dependencies of the old
> > version of the package *must* still be installed when the preinst of the new
> > package is being run, because the new-preinst is called by dpkg in the phase
> > when dpkg may still try to roll back to the old version on failure.

> Can you back up this statement with a reference in the policy manual?
> It seems that this may not always be possible, for instance when the old
> version of the upgraded package was not configured.

No, the current version of policy doesn't speak to this directly.  Here is
the proof that this is a bug in aptitude:

- The old version of the package depends on the old library.

- Policy requires that Depends: are satisfied for a package to be in the
  'configured' state.

- The prerm script is called before the package is deconfigured.

- Therefore, the package's dependencies must still be installed at the point
  when the prerm script is called; removing the dependency first violates
  the dependency relationship, and is a bug in whatever tool is doing this. 
  (N.B., dpkg itself does not enforce this when asked to remove dependencies
  of already-configured packages; it's the responsibility of the front end
  to get the order right.)

  - On package upgrade, the preinst script of the new package is called
    *before* the prerm of the old package.

  - Therefore, the preinst is being called while the old version of the
    package is still in "installed" state.

  - Therefore, it is a bug in the package manager that the dependencies of
    the old version of the package are not installed at the time the new
    preinst is run.

> OTOH, I found the following statement in section 7.2:

>           `Pre-Depends' are also required if the `preinst' script depends
>           on the named package.  It is best to avoid this situation if
>           possible.

> It seems that this is just the situation here.

No, it is not.  slapd does *not* have a dependency on obsolete and
no-longer-extant versions of the libldap library package; it only requires
that on upgrade, at the time the preinst runs, the old version of *slapd
itself* be in a consistent state.

This is standard practice in maintainer scripts.

> Compare also the discussion around #469552/#314571, especially your own
> statement in http://lists.debian.org/debian-devel/2008/07/msg01028.html.

If you don't understand the difference between these two cases, I fervently
hope that you aren't going anywhere near the package manager code.

-- 
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: