Hi,

Yves-Alexis Perez wrote:

> as said on irc, it'd be nice if dpkg could handle package upgrade
> involving symlinks and directories a bit more nicely.

See also [1], [2], and [3].

The intent of the current behavior is that the sysadmin is free to use
symlinks to cause files in one directory to appear on a different
partition, and dpkg will leave that alone rather than replacing it
with a directory.  For symmetry, dpkg will not automatically replace a
directory with a symlink, either.

Better semantics, implemented in maintainer scripts for many packages,
are:

 - after a directory changes to a symlink in the shipped package,
   change the directory on disk to a symlink, if it is a directory and
   is empty.  If it is not empty, make a backup and then put a symlink
   there.

 - before a symlink changes to a directory in the shipped package,
   check if there is a symlink to the shipped target there on disk.
   If so, remove the symlink and replace it with a directory.  (If
   not, leave the symlink alone.)

After a package has been unpacked, dpkg doesn't actually know which
files were originally directories or symlinks, so it can't currently
implement these semantics internally.  Maybe some mitigating features
would be possible, though?

 - teaching best practices about directory <--> symlink transitions to
   dpkg-maintscript-helper

 - adding a file to declare which directories changed to symlinks (and
   to where) or vice versa, and in which versions

[1] http://bugs.debian.org/316935
[2] http://bugs.debian.org/406715
[3] http://bugs.debian.org/182747




-- 
To UNSUBSCRIBE, email to debian-dpkg-bugs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to