Le dimanche 01 janvier 2012 à 20:27 +0100, Lars Wilke a écrit : > Hm, if i understand correctly the script would have to do the following: > > 1. foreach file in /usr/share/applications/*.desktop > 2. look for MIME relevant entries in $file > 3. find the corrosponding MIME definitions in /usr/share/mime > 4. generate mailcap line
Absolutely. Note that you can also use /usr/share/applications/mimeinfo.cache which has everything already compiled. > Questions: > - How to handle /usr/share/mime/aliases and /usr/share/mimelnk? One of the shortcomings of the mailcap system is its inability to handle aliases, so you would have to generate one line per alias. It doesn’t handle subclasses either, so you might want to generate lines for them too, maybe with lower priorities. > - Also the result would have to be merged with the mailcap file, as i.e. vim > has no corresponding .desktop file but has a /usr/lib/mime/packages entry. You have two good options for that: * make the script part of update-mime, so that it takes into account both databases (the difficulty is for handling duplicates); * make the script part of dh_installmime, to generate entries in /usr/lib/mime/packages and let update-mime deal with them at installation time. Cheers, -- .''`. Josselin Mouette : :' : `. `' `-
signature.asc
Description: This is a digitally signed message part