Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5048 - /etc/mailcap contains wrong entries
Summary: /etc/mailcap contains wrong entries
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-15 16:03 UTC by Sascha Silbe
Modified: 2004-10-02 22:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Silbe 2002-07-15 16:03:29 UTC
/etc/mailcap contains "fake" entries for audio/basic, text/*, ...:

audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; nametemplate=%s.au
text/*; gview '%s'; edit=gvim -f '%s'; compose=gvim -f '%s'; test=test "$DISPLAY" != ""
text/*; view '%s'; edit=vim '%s'; compose=vim '%s'; needsterminal

/usr/lib/mime/playaudio, gvim and vim do not exist on my system because I did not explicitly install those packages and they are not installed automatically (via dependencies). I'm using other alternatives (sox, nvi, ...) instead.
I suggest you let each (installed) package provide it's own mailcap file and concatenate them together to /etc/mailcap, like Debian does.
Comment 1 Grant Goodyear (RETIRED) gentoo-dev 2002-07-15 17:11:48 UTC
I think this one needs real work that I can't do right now.  Tossing back
into the pool....  
Comment 2 Grant Goodyear (RETIRED) gentoo-dev 2002-07-15 19:35:47 UTC
Sascha, 
  If you could provide a bit more info (or a url) on 
how debian handles mailap entries that might be very 
helpful.  Thanks! 
Comment 3 Sascha Silbe 2002-07-27 05:53:26 UTC
The source for the Debian 'mime-support' package can be found on: http://ftp.debian.org/debian/pool/main/m/mime-support/mime-support_3.18-1.tar.gz

Basically each package puts its mailcap entries into the file /usr/lib/mime/packages/<package-name> and runs update-mime on postinstall. update-mime concatenates (modulo some ordering logic defined in /etc/mailcap.order) those files to /etc/mailcap.

Comment 4 Nick Hadaway 2002-10-28 13:37:53 UTC
This should be a feature we add to portage.    
    
While the debian method may work, we can make it faster/better?    
While I haven't done any low-level coding with portage I think we should    
easily be able to make an update-mailcap script or an update-mailcap hook in    
portage.    
    
update-mailcap:    
  reads files in /etc/mailcap.d which contains files which have the same name    
as the portage package name installed.  These files contain lines which should  
be added to /etc/mailcap.  
  
for example:    
root# cat /etc/mailcap.d/xv  
# media-gfx/xv  
image/gif; xv %s  
image/jpg; xv %s  
  
Conflicting entries in mailcap can be a headache.  If a user has multiple  
entries with the same mime type... you will get problems.  
  
I would assume that the best way to deal with conflicting types is to have  
update-mailcap check for duplicate mime types.  When duplicate mime-types are  
found, display the conflicting entries and prompt the user to choose which one  
to use.  Upon choosing one or neither to be added, the process continues  
looking for further conflicts or finishes parsing entries and writes the files 
output to /etc/mailcap.  We could also set an option so that when conflicting 
entries are found, they aren't added so if people want to run an automated 
update script (via cron or something of the like) they still can... 
 
This also could possibly be something added to env-update parsing as well...  
adding a MAILCAP="blah" line to the files in /etc/env.d...  
 
I need more input on this from the actual portage developers. 
Comment 5 Nick Hadaway 2002-10-28 13:46:54 UTC
drobbins, am I way off base or am I pushing in the right direction?

This solution is also a possible solution for "Gentoo" menus in X Window 
Managers as well... parsing a file (/etc/env.d/* or some other appropriate 
directory) for variables and putting the output to a file to populate menu 
entries.

Let me know what you think.
Comment 6 Sascha Silbe 2002-10-29 10:28:09 UTC
I like the Debian method of having an /etc/mailcap.order better. This way I only need to interact if a new package gets installed. Updates are fully automated.
It's annoying enough to cycle through /etc/init.d/* etc. after updating. I don't want to put /etc/init.d into CONFIG_PROTECT_MASK, though, so I can still modify some of the files. Perhaps storing an MD5 of the original config file and comparing it during the update would be a good idea. But that's OT in this bug. ;)

Comment 7 Nick Hadaway 2002-12-12 23:47:51 UTC
Okay so the manual running of mailcap-update isn't perfect but I still don't 
think we should just take debian's solution.

I think I like the idea of adding the support to env-update better as really 
the mailcap is "env" related.  I have yet to look deeply into env-update as 
this is not something I am worried about getting into the 1.4 release.  It's 
coming soon though. :)
Comment 8 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-08 01:39:52 UTC
Graham, can you hack up a perl script for us?
Comment 9 Andrew Cooks (RETIRED) gentoo-dev 2004-01-23 11:58:00 UTC
This bug is about to die from old age.

I'm adding bug-wranglers to the CC list to see if anyone is interested in this or have any more input.

Yeah, I'm the ass who's bumping up inactive bugs as if we don't have enough active ones, but a nice complete list of ancient bugs and forgotten feature requests is not of much use.
Comment 10 Adam 2004-04-09 08:49:44 UTC
Isn't this they way env-update works?  Each package provides a small bit of info in /etc/profile.d and env-update assembles them together?
Comment 11 rob holland (RETIRED) gentoo-dev 2004-07-16 02:00:00 UTC
Is an env-update approach better than nothing for now? I'm happy to have a go at putting one together. Maybe we can try that and see if we like it, then scrap it if its useless?
Comment 12 SpanKY gentoo-dev 2004-10-02 22:16:22 UTC
handled by net-mail/mailbase now