[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:
>  Richard> This seems unnecessarily complex.  You do not need to change
>  Richard> the directory.
> 
>         Well, it makes me feel better when creating symbolic links. 

Okay, a matter of taste :) I find it hard to read scripts that change
directories, and I also think it encourages the wrong way of thinking
about "ln -s" (which is unlike any other file operation when it takes
its first argument absolutely literally.)

>  Richard> One problem remains: There is no $package variable available
>  Richard> when the maintainer scripts are run.  The package name will
>  Richard> have to be hardcoded in the scripts, and for multi-binary
>  Richard> packages that will be rather more work than is advertised.
> 
>         For multi binary packages I tend to have separate installation
>  script for each binary package. Is that not the case generally? (I
>  also tend to have the package name in a lot of maintainer scripts, as
>  well as the version, but that does not seem to be the norm).

I do not know.  I thought the xserver-* scripts were like that (a
common script for many packages), but they seem to have the package
name in each script.

It would annoy me to have to add parameter substitution just for this,
but I guess that is also a matter of aesthetics.

>         Would something like this help?
> 
> PACKAGES="package_A package_B package_C"
> for package in $PACKAGES; do
>    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
> done

I don't think so; each package must take care of its own link, to avoid
getting in dpkg's way.  Examples of this going wrong are pretty complex
for the postinst, but for the prerm it's easy: each package must remove
only its own link.

Richard Braakman


Reply to: