2.2. Symbolic Link Policy for Migration to /usr/share/xml

For packages that are migrating their files from /usr/share/sgml to /usr/share/xml, symbolic links must be placed in the previous /usr/share/sgml install location that point to the current installation in /usr/share/xml. Whether the links are to files or to directories needs to be be determined on a case-by-case basis. Creating such links should reduce the number of backward compatibility problems during the migration to /usr/share/xml.

Note

dpkg does not support the automatic conversion of directories into symlinks during package upgrade. So, if the directory /usr/share/sgml/frob becomes a symlink to /usr/share/xml/frob, as you migrate your XML packages to /usr/share/xml, you'll need to put in logic to handle this conversion.

The simplest method is to put the following snippet in your preinst:

if [ "$1" = upgrade -a -d /usr/share/sgml/frob ]; then 
  rm -rf /usr/share/sgml/frob 
fi

and follow it with code that creates the correct symlink.