On Thu, Jun 12, 2008 at 08:25:25PM +0000, Debian Bug Tracking System wrote:
> Date: Thu, 27 Dec 2007 09:16:45 +0200
> Source: dpkg
> Binary: dpkg dselect dpkg-dev
> Architecture: source i386 all
> Version: 1.14.13
> Distribution: unstable
> Urgency: low
> Maintainer: Dpkg Developers <[EMAIL PROTECTED]>
> Changed-By: Guillem Jover <[EMAIL PROTECTED]>
> Description: 
>  dpkg       - package maintenance system for Debian
>  dpkg-dev   - package building tools for Debian
>  dselect    - user tool to manage Debian packages
> Closes: 76295 109794 200454 220044 229143 245562 246906 356299 373003 377400 
> 392440 433567 441021 443241 451872 452730 453364 453885 454616 455260 455520 
> 455841 456984 457673 457739 457784
> Changes: 
>  dpkg (1.14.13) unstable; urgency=low
> ...
>    * Fail when diverting to a non existent directory. Closes: #245562
>      Thanks to Flavio Stanchina <[EMAIL PROTECTED]>.

This change is specifically what caused the behavior seen in #476973.
dpkg-divert is typically called in preinst/postrm.  In both of these
scenarios, it can not be expected that the directory which contains the
file-to-be-diverted or the divert-to-file exists since the package
hasn't been unpacked or has already been removed, respectively.

If the file in question exists in a typical directory (like /usr/bin,
/usr/sbin, etc.), then the directory likely already exists due to some
other package.  In the case of a package diverting a file supplied
purely by its own binary packages, it is more likely that the directory
does not exist yet.

I'm currently running into this problem with the Vim packages where I am
trying to divert /usr/share/vim/vim71/doc/help.txt (and the tags file in
the same directory).  Because of the above change to dpkg-divert, I now
have to add dirty hacks in preinst/postrm to create the missing parts of
the directory structure, if it doesn't exist, call dpkg-divert and then
remove the bits of the directory structure I added.  I'm taking care to
only create/remove exactly the part of the directory structure that
doesn't exist yet, but it is very tedious and work that shouldn't be
required.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature

Reply via email to