Section: Update MIME Programs (8)
Updated: 12th Feb 2012
update-mime updates the /etc/mailcap file to reflect mime information changed by a Debian package during installation or removal.
--local Generate files in the current user's home directory instead of /etc. This allows users to create a custom ordering configuration and get a complete ~/.mailcap file out of it.
The order of entries in the /etc/mailcap file can be altered by editing the /etc/mailcap.order file. Please see the (5) man page for more information.
To create entries in the mailcap file, packages need to create a file in the /usr/lib/mime/packages directory. In this file goes the verbatim desired mailcap entries. In addition to the standard mailcap options (described below) is a new priority option. Specifying this will provide for simple ranking of programs within a given mime type. An animation viewer, for example, may be able to display a static picture, but probably wouldn't be the best choice and so would give an option like "priority=2". Priorities range from 0 to 9, with 0 being the lowest and 9 being the highest. If the priority option is omitted, a value of 5 is used.
The following are standard options that can be specified in the mailcap entry. Options are separated by semicolons (;) but must all be on the same line. Each line should look like:
mime/type; viewer; option; another=val; etc; priority=5
Mime types of the form "class/*" and even "*/*" are now acceptable (they were previously disallowed). When using "class/*", it is probably a good idea to add a "priority=[1-4]" option so specific rules using the default priority will get chosen first. If using "*/*", though, you probably want to add a "priority=0" option to make that rule a "last resort".
These options are modifiers to all the commands specified on the command line.
Note: When testing for X by looking at the DISPLAY environment variable, please use one of:
test=test -z "$DISPLAY" (no X)
or test=test -n "$DISPLAY" (have X)
Many programs recognize these strings and optimize for them.
These options provide additional information about the given content-type.
Packages that wish to provide MIME access to themselves should not depend on, recommend, or suggest mime-support, as the the file they create in /usr/lib/mime/packages will cause update-mime to be automatically run via a Dpkg trigger.
In addition to the abovementioned mechanism update-mime also parses desktop entries in /usr/share/applications/ to generate mailcap entries. These entries are given a lower priority than those in /usr/lib/mime/packages.
update-mime was written by Brian White <email@example.com>
update-mime is in the public domain (the only true "free").
Tutoriais de Tecnologia Web