Alternatives problems

James Vega jamessan at
Wed Mar 15 03:33:52 UTC 2006

I noticed today that there is a slight problem with installing multiple
variants alongside each other.  As an example, both vim-perl and
vim-python would run the following command in their postinst:

  update-alternatives \
    --install /usr/bin/vi vi /usr/bin/vim 50 \
    --slave $mandir/vi.1.gz vi.1.gz $mandir/vim.1.gz

This results in only one entry listed in update-alternatives:

  sisyphus:/home/jamessan# update-alternatives --display vi
  vi - status is auto.
   link currently points to /usr/bin/vim
  /usr/bin/vim - priority 10
   slave vi.1.gz: /usr/share/man/man1/vim.1.gz
  Current `best' version is /usr/bin/vim.

Now, if vim-perl is removed, this command is run in its prerm:

  update-alternatives --remove vi /usr/bin/vim

Suddenly we have no vi alternative and thus no vi(1)!  This can be
solved fairly easily, but it will add a lot of clutter to
/etc/alternatives.  The quick solution is to have the alternatives point
to vim.$variant instead of the vim alternative and to have the slave
names be $alternative.$variant.1.gz (e.g., vi.perl.1.gz) so that they
are unique for each program for which we have alternatives.  This is
only slightly ugly with the vim6 package, but it comes much more so with
vim7 because we have 9 manpage slaves for each alternative that is

Another possibility would be to move the manpages into each variant
package and name them after the binary being installed (e.g., vim-perl
would have /usr/bin/vim.perl and /usr/share/man/man1/vim.perl.1.gz).
Then each variant would have distinct files pointed at by the
alternatives and they would be maintained properly.  The downside to
this is that multiple copies of the same manpages would be installed.


GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 199 bytes
Desc: Digital signature
Url :

More information about the pkg-vim-maintainers mailing list