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

Bug#40706: AMENDMENT 17/7/99] /usr/share/doc vs. /usr/doc transition



Manoj Srivastava wrote:
> 3. Proposed solution
> --------------------
> 
>      I propose that there be a syymlink from /usr/doc/package =>
>      /usr/share/doc/package, managed by the package itself. Since there is
>      some concern that the packaging system does not deal well with
>      replacing a directory with a symbolic link, it is suggested that the
>      link be manipulated in the maintainer scripts postinst and postrm.

That should be postinst and prerm, to stay out of dpkg's way.  If you
remove it only in the postrm, then you will break downgrades to pre-FHS
versions.

To be completely correct, the symlink should also be removed in the
postrm if it is called with "disappear", because the prerm is not
called in that case.  It is rare for packages to disappear, however.

I think the symlink should be absolute, not relative.  /usr/doc is a
likely directory to be symlinked to somewhere else by the sysadmin
(for example, to deal with this transition :-), and the normal reason
for using relative links (that the link should still work if the
filesystem is mounted in an unusual place) is not very important here.

>           	  Postinst install:
>           if [ -d /usr/doc ]; then
>             if [ ! -e /usr/doc/$package ]; then
>               (cd /usr/doc;
>                if [ -d ../share/doc/$package ]; then
>                   ln -s ../share/doc/$package $package ;
>                fi
>               )
>             fi
>           fi

This seems unnecessarily complex.  You do not need to change the directory.
I suggest (using absolute links while I'm at it):

           if [ -d /usr/doc ]; then
             if [ ! -e /usr/doc/$package -a -d /usr/share/doc/$package ]; then
               ln -s /usr/share/doc/$package /usr/doc/$package
             fi
           fi

One problem remains: There is no $package variable available when the
maintainer scripts are run.  The package name will have to be hardcoded
in the scripts, and for multi-binary packages that will be rather more
work than is advertised.

Richard Braakman


Reply to: