Joey Hess wrote:
> This is the main reason I've never come up with such a script. I dislike
> this config file format, but I can't come up with a better one.
> 
> I think this format is too obscure to be useful. Raw update-alternatives
> commands in a postinst are more understandable.
[...]
> > Would you be interested in including this in debhelper?
> 
> Yes, if we can come up with a better config file format.

Sorry for respawning this issue after such a long time...

A better config file format could possibly be one which mimics the way 
update-alternatives is called: it would simplify things only if you consider 
that bugs caused by update-alternatives --remove commands being out of sync 
with their --install counterparts.

The proposed format is like the following:

<link> <name> <path> <priority>
 <slave-link> <slave-name> <slave-path>
 ...

<link> <name> <path> <priority>
 ...

Where slave lines (if any) begin with any amount of white space and an empty 
line separates stanzas (if there are more than one).

Using the following format, the config file for e.g. mawk would be:

/usr/bin/awk awk /usr/bin/mawk 5
 /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/mawk.1.gz
 /usr/bin/nawk nawk /usr/bin/mawk
 /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/mawk.1.gz

And for e.g vim, it would look like:

/usr/bin/vi vi /usr/bin/vim 120
 /usr/share/man/man1/vi.1.gz vi.1.gz /usr/share/man/man1/vim.1.gz

/usr/bin/view view /usr/bin/vim 120
 /usr/share/man/man1/view.1.gz view.1.gz /usr/share/man/man1/vim.1.gz

/usr/bin/ex ex /usr/bin/vim 120
 /usr/share/man/man1/ex.1.gz ex.1.gz /usr/share/man/man1/vim.1.gz

/usr/bin/editor editor /usr/bin/vim 120
 /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/vim.1.gz

(I admit that, in this case, a for loop in the maintainer scripts would be 
less redundant, but a package maintainer can choose whether to use this 
facility.)

Regards,
Danilo

-- 
Danilo Piazzalunga                     +--------------------+
PGP Key available at subkeys.pgp.net   | Linux User #245762 |
Fingerprint: D018 815E 8C7F 2AE2 5565  | ICQ #105550412     |
             0C36 B5F6 DB20 B800 CB9F  +--------------------+


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to