Bug 88004 - subclasses declared have wrong case
Summary: subclasses declared have wrong case
Status: RESOLVED NOTOURBUG
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Shared Mime Info group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-03 23:55 UTC by emrecio
Modified: 2016-08-02 11:36 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description emrecio 2015-01-03 23:55:40 UTC
The following subclasses, are declared as "macroEnabled" in the subclasses file, but on the filesystem they are "macroenabled". As a work-around I updated the subclasses file to point to lowercase version in the applications directory.

-- workaround 
$ sudo mv /usr/share/mime/subclasses /usr/share/mime/subclasses.BAK
$ sudo sed -e 's/macroEnabled/macroenabled/' /usr/share/mime/subclasses.BAK > /usr/share/mime/subclasses

-- the following was the error message for every KDE application. In this case it was "kdesvn"

kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.sheet.binary.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.addin.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.sheet.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.presentation.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-word.template.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.template.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.template.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-word.document.macroEnabled.12" 
kdesvn(9797) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.slide.macroEnabled.12"
Comment 1 emrecio 2015-01-03 23:58:17 UTC
The package was from Fedora 21 just installed:
shared-mime-info-1.3-15.fc21.x86_64
Comment 2 Rex Dieter 2015-01-22 13:32:03 UTC
$ grep -ri macroEnabled *
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-excel.addin.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-excel.sheet.binary.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-excel.sheet.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-excel.template.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-powerpoint.addin.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-powerpoint.presentation.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-powerpoint.slide.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-powerpoint.slideshow.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-powerpoint.template.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-word.document.macroEnabled.12">
freedesktop.org.xml.in:  <mime-type type="application/vnd.ms-word.template.macroEnabled.12">

This is the source of the definitions, seems there are some options to consider:
* patch freedesktop.org.xml.in to use macroenabled instead (probably not an option, if case is indeed important)
* find/fix why the generated subclasses is using lowercase
* decide that KMimeTypeRepository:parents' code assumption that cases match is invalid, and fix that instead
Comment 3 Rex Dieter 2015-01-22 13:48:12 UTC
See related issue bug #82782 (probably a dup)
Comment 4 Bastien Nocera 2015-01-28 11:18:06 UTC
(In reply to emrecio from comment #0)
> The following subclasses, are declared as "macroEnabled" in the subclasses
> file, but on the filesystem they are "macroenabled".

That's not a bug. Mime-types are case unsensitive. See:
https://bugs.freedesktop.org/show_bug.cgi?id=62473
for details.
Comment 5 Zbigniew Jedrzejewski-Szmek 2015-01-28 13:25:19 UTC
(In reply to Bastien Nocera from comment #4)
> That's not a bug. Mime-types are case unsensitive. See:
> https://bugs.freedesktop.org/show_bug.cgi?id=62473
> for details.

More precisely, it's not a bug in shared-mimo-info, but in kdesvn it seems.
Comment 6 Ahmad Samir 2015-01-28 13:46:15 UTC
(In reply to Zbigniew Jedrzejewski-Szmek from comment #5)
> (In reply to Bastien Nocera from comment #4)
> > That's not a bug. Mime-types are case unsensitive. See:
> > https://bugs.freedesktop.org/show_bug.cgi?id=62473
> > for details.
> 
> More precisely, it's not a bug in shared-mimo-info, but in kdesvn it seems.

It's most likely something lower in the KDE stack (kdelibs would be my guess), because I see similar errors with kwrite and dolphin.
Comment 7 Rex Dieter 2015-01-28 13:46:57 UTC
Yes, kdelibs owns the related mimetype classes
Comment 8 Rex Dieter 2015-01-28 16:15:58 UTC
File bug @ kde:

https://bugs.kde.org/show_bug.cgi?id=343468
Comment 9 emrecio 2015-01-30 03:32:19 UTC
So I took a look at the bug report listed below, how is this fixed? At the "implementation" level ... meaning that I have to file a bug report with Fedora??
Comment 10 emrecio 2015-01-30 03:35:14 UTC
(In reply to Zbigniew Jedrzejewski-Szmek from comment #5)
> (In reply to Bastien Nocera from comment #4)
> > That's not a bug. Mime-types are case unsensitive. See:
> > https://bugs.freedesktop.org/show_bug.cgi?id=62473
> > for details.
> 
> More precisely, it's not a bug in shared-mimo-info, but in kdesvn it seems.

All KDE apps do this though once they load data. If you start the app (i.e.: kate/kwrite/kdesvn/...) no warnings/errors. However, if you start the app or open a file the messages appear. So should it be a kdelibs bug report? They're the ones who pointed me here ... IIRC.
Comment 11 Rex Dieter 2015-01-30 13:31:39 UTC
See comment #8 about the relevant kde bug
Comment 12 David Faure 2015-08-30 21:15:37 UTC
The problem is that /usr/share/mime/packages/libreoffice.xml defines

  <mime-type type="application/vnd.ms-excel.sheet.macroenabled.12">

while freedesktop.org.xml defines

  <mime-type type="application/vnd.ms-excel.sheet.macroEnabled.12">

IMHO this is a libreoffice bug, they shouldn't redeclare things that are already
declared in fdo, and get the case wrong on top.

But yes, not a shared-mime-info bug indeed.
Comment 13 emrecio 2016-03-09 14:48:55 UTC
(In reply to David Faure from comment #12)
> The problem is that /usr/share/mime/packages/libreoffice.xml defines
> 
>   <mime-type type="application/vnd.ms-excel.sheet.macroenabled.12">
> 
> while freedesktop.org.xml defines
> 
>   <mime-type type="application/vnd.ms-excel.sheet.macroEnabled.12">
> 
> IMHO this is a libreoffice bug, they shouldn't redeclare things that are
> already
> declared in fdo, and get the case wrong on top.
> 
> But yes, not a shared-mime-info bug indeed.

I don't have LibreOffice installed. I just was starting Kate:

foo@bar.com:/home/foo> kate&
[1] 25481
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.sheet.binary.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.addin.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.sheet.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.presentation.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-word.template.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-excel.template.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.template.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-word.document.macroEnabled.12" 
kate(25481) KMimeTypeRepository::parents: "/usr/share/mime/subclasses"  refers to unknown mimetype  "application/vnd.ms-powerpoint.slide.macroEnabled.12"
Comment 14 Bastien Nocera 2016-08-02 11:36:50 UTC
I'm closing this as "not our bug" until such a time that somebody shows that shared-mime-info is at fault.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.