[Pkg-samba-maint] Moving swat documentation, dpkg issues?
adconrad at 0c3.net
Sat Dec 3 23:26:44 UTC 2005
Steve Langasek wrote:
>>It seems as though dpkg is having some troubles changing a directory
>>to a symlink during a package upgrade. Does that make sense?
> Yes. This is documented in Policy 6.5, #4.
This is done in the php packages and the openssh packages, both
using the same "trick".
1) change packaging to install files to one package instead of the other
2) ship the symlink in your package
3) In POSTINST (not preinst, or any other place where it may seem
clever), check if you have a directory or a symlink. If it's still a
directory, 'rm -rf && ln -s [...]'
It's very important this is done in postinst, as this means it happens
long after dpkg has done any of the fun "unpack, remove files, confuse
the crap out of you" changes it will do in the previous steps to make
this not work how you thought it should. (for instance, if you do the
directory->symlink migration in preinst, then dpkg will happily follow
that symlink and remove the files there that are "no longer in your
More information about the Pkg-samba-maint