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

Bug#155849: dpkg: Programs misbehave when called through alternatives. Proposal to change symlinks to scripts

Package: dpkg
Version: 1.9.21
Severity: minor

If /etc/alternatives/editor points to /usr/bin/jemacs, which is a link
to /usr/bin/joe meant to call joe with emacs key bindings, then whenever
"editor" is invoked joe will come up with its default behaviour (no emacs
key bindings).

This is, of course, due to the fact that the final binary receives the
first name used in the symlink chain, which was "editor". The only way
to break this flow seems to be to have an explicit call to the alternative
(jemacs) somewhere in the chain.

This minor breakage in the alternatives system usefulness could be
overcome by turning /etc/alternatives into a script farm instead of the
symlink farm it is now. Instead of re-linking /etc/alternatives/editor
to the chosen item (/usr/bin/jemacs), update-alternatives would perform
simple one-line edits, through sed, on the /etc/alternatives/editor script,
changing 'exec vi "$@"' to 'exec jemacs "$@"'.

Thanks for your time.

-- System Information
Debian Release: testing/unstable
Architecture: i386

Carlos Sousa

Reply to: