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

Re: packages using files in /usr/share/doc



On Sun, Apr 20, 2003 at 12:12:05PM -0400, Joey Hess wrote:
> One thing I notcied, and did not file bugs on is a lot of packages do
> something like this:
> 
>          ln -sf groff-base /usr/share/doc/groff
> 
> Of course this fails if you have no /usr/share/doc and dpkg has excludes
> support! I have to wonder why these things are done programmatically in
> the postinst, instead of just dropping the appropriate link into the
> data.tar.gz, but I hesitate to file bugs on there as there are quite a
> few and it doesn't break yet, or really voiolate a tight reading of
> policy.

That particular case makes sense and is safe if you check the context:

  if dpkg --compare-versions "$2" lt-nl 1.17-1; then
      # dpkg won't replace the directory /usr/share/doc/groff with a symlink,
      # so do that now.
      if [ ! -L /usr/share/doc/groff -a -d /usr/share/doc/groff ]; then
          if rmdir /usr/share/doc/groff 2>/dev/null; then
              ln -sf groff-base /usr/share/doc/groff
          fi
      fi
  fi

While I understand why the directory/symlink replacement code is the way
it is, it can be a pain at times.

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: