Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 585784 - Unknown media type errors in sci-chemistry/chemical-mime-data
Summary: Unknown media type errors in sci-chemistry/chemical-mime-data
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeffrey Gardner (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-13 07:44 UTC by Fabio Coatti
Modified: 2016-11-21 19:10 UTC (History)
3 users (show)

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


Attachments
chemical type patch (chemical-mime-type.patch,393 bytes, patch)
2016-10-31 19:03 UTC, Fabio Coatti
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Coatti 2016-06-13 07:44:50 UTC
The mime types provided by /usr/share/mime/packages/chemical-mime-data.xml makes update-mime-database to emit error messages like "Unknown media type in type 'chemical/x-turbomole-grad'".
I don't know if it is the mime type to be wrong or update-mime-info to be too picky, though.

Reproducible: Always




Packages: 
sci-chemistry/chemical-mime-data-0.1.94-r3
x11-misc/shared-mime-info-1.6
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2016-07-14 06:29:40 UTC
Just leave them. THese warnings have been there for ever. No idea where they came from but they do not harm.
Comment 2 Fabio Coatti 2016-07-14 07:05:04 UTC
Interesting approach. The issue is there, no idea about it but it does no harm, so close it. I'm not really sure how you can say that there is no harm when you, admittedly, have no idea about it.

I understand that you may have no time or will to look at it, but closing the ticket is probably the worst thing to do. And "works for me" is a bogus claim, as it *does not* works for you. 

Maybe leaving it open will allow with someone with more clues about the issue to solve it, what do you think?
Comment 3 Steven Green 2016-10-29 17:57:03 UTC
I've found the cause of this.
The package sci-chemistry/chemical-mime-data adds a file usr/share/mime/packages/chemical-mime-data.xml that has all these unknown mime-types in.

The utility update-mime-database which is part of the package x11-misc/shared-mime-info has a hard coded array of media_types[]:

/* This is the list of directories to scan when finding old type files to
 * delete. It is also used to warn about invalid MIME types.
 */
const char *media_types[] = {
        "text",
        "application",
        "image",
        "audio",
        "inode",
        "video",
        "message",
        "model",
        "multipart",
        "x-content",
        "x-epoc",
        "x-scheme-handler",
};

The function get_type() in update-mime-database.c compares the mime type to this array and since "chemical" is not in this list it prints out a warning.

It seems like a harmless warning, but it is a pity there is not a way to suppress it.

Solution include removing the warning from update-mime-database, add "chemical" to the media_types array, or only display these message if -V (verbose) added to update-mime-database command.
Comment 4 Fabio Coatti 2016-10-31 19:03:46 UTC
Created attachment 452041 [details, diff]
chemical type patch
Comment 5 Fabio Coatti 2016-10-31 19:04:52 UTC
I tried to add "chemical" to the list of directories and indeed the messages disappears, as suggested by Steven Green.
If someone is bothered by this message as I am, just create /etc/portage/patches/x11-misc/shared-mime-info-1.7/ and put in it the attached patch...