Bug 1300723 - Mathematica entry in freedesktop.org.xml conflicts/breaks vendor supplied mime info
Mathematica entry in freedesktop.org.xml conflicts/breaks vendor supplied mim...
Product: Fedora
Classification: Fedora
Component: shared-mime-info (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Bastien Nocera
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-01-21 09:37 EST by Jonathan Underwood
Modified: 2016-12-20 13:03 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 13:03:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Vendor provided mime info for .nb files (398 bytes, text/plain)
2016-01-21 09:51 EST, Jonathan Underwood
no flags Details
Vendor supplied .desktop file (563 bytes, text/plain)
2016-01-21 09:52 EST, Jonathan Underwood
no flags Details
Patch to reduce priority and weight of mime matches for mathematica .nb files (719 bytes, patch)
2016-01-22 08:59 EST, Jonathan Underwood
no flags Details | Diff

  None (edit)
Description Jonathan Underwood 2016-01-21 09:37:54 EST
Description of problem:
Mathematica (10) provides a set of mime info files. If they're installed on Fedora 23, they don't actually do the job you expect, and the reason is that the entry in freedesktop.org.xml overrides the vendor supplied ones, so the wrong image icon is chosen, and notebook files are detected as having mime type application/mathematica rather than application/vnd.wolfram.nb, which is what is expected by the vendor supplied .desktop file.

In summary, the mathematica entry in freedesktop.org.xml should be removed. It's broken, and breaks installations of mathematica.
Comment 1 Jonathan Underwood 2016-01-21 09:51 EST
Created attachment 1116959 [details]
Vendor provided mime info for .nb files

For reference I'm attaching the upstream mime and .desktop files.
Comment 2 Jonathan Underwood 2016-01-21 09:52 EST
Created attachment 1116960 [details]
Vendor supplied .desktop file
Comment 3 Jonathan Underwood 2016-01-22 08:59 EST
Created attachment 1117208 [details]
Patch to reduce priority and weight of mime matches for mathematica .nb files

The attached patch should fix the issue by down weighting the shipped mathematica .nb mime definitions, such that if the vendor supplied definitions are present, they're used in preference.

However, for some reason, with this patch, the results are inconsistent:

$ xdg-mime query filetype exercise3.nb 

$ mimetype exercise3.nb 
exercise3.nb: application/vnd.wolfram.nb

The first result is wrong, the second result is right. Nautilus also gets it wrong. gvs-info output:

$ gvfs-info exercise3.nb
display name: exercise3.nb
edit name: exercise3.nb
name: exercise3.nb
type: regular
size:  10917
uri: file:///home/jgu/Teaching/PHAS1449/2015-2016/Lecture%203/exercise3.nb
  standard::type: 1
  standard::name: exercise3.nb
  standard::display-name: exercise3.nb
  standard::edit-name: exercise3.nb
  standard::copy-name: exercise3.nb
  standard::icon: application-mathematica, x-office-document
  standard::content-type: application/mathematica
  standard::fast-content-type: application/vnd.wolfram.nb

So I dunno... something is very broken with mime matching currently I think. Or I've done something dumb.
Comment 4 Jonathan Underwood 2016-01-22 09:04:27 EST
With that patch applied, /usr/share/mime/globs2 contains:


so, any .nb file really should be recognized as application/vnd.wolfram.nb, so I am totally confused as to why that's not happening.
Comment 5 Jonathan Underwood 2016-01-22 12:01:01 EST
Even more interestingly, with the patch installed:

$ kmimetypefinder junk.nb
(accuracy 100)

So, seems there's actually a bug in gvfs.

Anyway, to close this bug, applying the patch attached should be all that's needed.
Comment 6 Fedora End Of Life 2016-11-24 10:05:49 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Fedora End Of Life 2016-12-20 13:03:21 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.