Re: update-alternatives and ispell dictionaries
email@example.com writes (filling of lines to the right-hand
margin undone - iwj):
> Anyway, I've just converted the dictionary installation scripts to
> use update-alternatives instead of nasty, bug-ridden perl
> monstrosities. I'm looking for some advice on how to assign
> priority numbers to the different languages, and how the system
> administrator can pick a default at install time, or later.
There's no facility in update-alternatives for having the sysadmin
pick a default. In order to override update-alternatives's priority
arrangements they have to modify the link manually (and a postinst
script shouldn't do it).
> Ideally, I'd like the postinst script to prompt...'Would you like
> <language> to be the system default?' and have update-alternatives
> "do the right thing". I don't see how update-alternatives can be
> forced to make the current set of links being installed the default,
> without interrogating the /var/lib/dpkg/alternatives/<package> file
> and setting the priority higher than any found in there.
That's not the right thing to do. I think that what you're doing
isn't what update-alternatives is supposed to help you do.
update-alternatives assumes that all of the alternatives are
reasonable, and that the user doesn't need to be prompted.
What you're trying to do is give the user a list of the available
languages and have them choose one once, I think.
IMO the right thing to do is to write a different script, which asks
the user which dictionary they want, offering them the choice of the
ones in /usr/dict or wherever.
Perhaps update-alternatives could be extended to do this at some later
point, but it would have to be called in the preinst as well as the
postinst, with different options, so that by the time the first
postinst runs all the info is available.
> What happens if update-alternatives finds two packages with the
> highest priority?
It picks one or the other apparently at random. This case should be