Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296918 - miscategorized mimetypes
Summary: miscategorized mimetypes
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux bug wranglers
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-14 18:51 UTC by Peter
Modified: 2010-03-23 19:35 UTC (History)
2 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 Peter 2009-12-14 18:51:22 UTC
I believe several of the mimetypes are miscategorized.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560118

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2009-12-18 17:23:40 UTC
Please explain which packages are affected and how. Since your Debian bug report does not convey any sense either that according to [1] these are wrong, you will have to be explicit about which MIME types you mean and which packages install them. It would also help if you explained which packages have real problems with these MIME types. Warnings and errors of commands that relate to these would be nice, for instance.

[1] http://www.iana.org/assignments/media-types/index.html
Comment 2 Peter 2009-12-18 20:01:52 UTC
I'm sorry, I thought it would be obvious.

application/x-go-sgf is a problem for me because of software I work on that has the correct categorization of "text".

But I'm pretty sure chess pgn and ruby files are also miscategorized.  It doesn't cause any bugs that I know of, but they're wrong.  Those should be under text according to the mimetypes spec.

Look at text/x-csrc, text/x-dsrc, etc., etc., and then consider application/x-ruby?!?!
Comment 3 Wormo (RETIRED) gentoo-dev 2010-01-01 02:18:48 UTC
The freedesktop mime database expresses the text nature of these filetypes by listing them as text/plain subclasses. 

http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.18.html#subclassing

You didn't mention what application is causing problems with the current mime entry, but it might not be using the mime database correctly. There are various libraries for accessing it, and maybe they don't all pay attention to subclasses?

http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec?action=show&redirect=Standards%2Fshared-mime-info-spec#head-08acf7d5628532f446bb7df6ac2535cefba046cf
Comment 4 Peter 2010-01-01 03:04:44 UTC
Actually, the problem is with my application installing .desktop files and another bug with KDE that's unrelated.  Long story short, icons are stored in different directories based on mimetype classes so I figured getting x-sgf set to text in the mimetype database was a first step.  

As for the accuracy of chess and ruby and possibly other mimetypes, I don't know what that would impact so I'm just mentioning those if no one has noticed.
Comment 5 Wormo (RETIRED) gentoo-dev 2010-01-01 18:46:39 UTC
Well I don't think you'll get the freedesktop.org guys to admit that their database is wrong, because it is complying with their spec that says you can indicate text formats by subclassing; I count 47 different filetypes in shared-mime-info-0.60 that are text subclasses but don't start with "text/"

So, it seems like the application should be taught to pay attention to /usr/share/mime/subclasses. I gather you're a developer for this application, so you might even make that change yourself. Alternatively, if you think the whole subclassing thing was a design mistake and you want all your text filetypes to start with "text/", you can actually add a file named "Override.xml" to override them locally and rebuild your database (see the spec linked to previously).
Comment 6 Peter 2010-01-02 03:54:46 UTC
Wait, so you're saying its okay for a text subtype to be listed under application?  That that complies with the "spec"?
Comment 7 Wormo (RETIRED) gentoo-dev 2010-01-02 05:56:54 UTC
Yes, that's how I read the spec. Did you get a different impression from it?
Comment 8 Peter 2010-01-04 19:57:54 UTC
So basically, someone added a bunch of inaccurate mimetypes and because they're not technically a violation of the spec, no one will ever fix them?  Great.  
Well, whatever, I'll work around it.  Thanks for talking me through it anyway.
Comment 9 Wormo (RETIRED) gentoo-dev 2010-01-06 06:53:19 UTC
If that's the way you want to look at it :]

In my opinion, the entries are fully in the spirit of the spec, not just valid by a technicality. I think your complaint is with the spec that allows expressing text formats using this new subclass concept, rather than enforcing the old unix mimetype convention where they are all named "text/blah".

Ok to close this bug now, since it seems unlikely that you'll get the freedesktop devs to agree that their subclass stuff sucks and they should rename 47 entries using the "text/blah" convention?
Comment 10 Peter 2010-01-06 16:21:31 UTC
Why have a database at all?  Why not just call everything application/octet-stream?

Its not such a big deal, except that its used to determine directories for icons by KDE and possibly gnome.  Which means if I want to use a particular icon, I have to make my application less correct because the mime database is incorrect.

Sure, close it, I give up.
Comment 11 Wormo (RETIRED) gentoo-dev 2010-01-10 23:37:52 UTC
I take back the suggestion to close this report right now, if you're willing explain in more detail how KDE is getting things confused with these mimetypes. The "making a long story short" was too short to follow, but given a better explanation it might be apparent that KDE mime library is ignoring mime subclasses. And gnome as well, based on your debian bug report. In which case there could be 2 upstream bug reports filed against KDE and gnome, or possibly just 1 against the shared mime database since there's no use in having stuff in the spec that nobody wants to implement correctly...
Comment 12 Doktor Notor 2010-02-17 04:09:09 UTC
This stuff belongs to https://bugs.freedesktop.org and not to Gentoo/Debian/whatever bugtrackers... 
Comment 13 Ben de Groot (RETIRED) gentoo-dev 2010-03-23 19:35:48 UTC
This should be reported to the relevant upstream bugtrackers.