Created attachment 19722 [details] [review] patch for freedesktop.org.xml.in and tests/list application/x-sqlite2 has a magic match defined. I tried adding a subclass of it, kexi-specific, that has a glob. <mime-type type="application/x-kexiproject-sqlite2"> <_comment>Kexi database file-based project</_comment> <sub-class-of type="application/x-sqlite2"/> <glob pattern="*.kexi"/> </mime-type> (as well as another mimetype with *.kexi, and which derives from sqlite3) However ../xdgmime/src/test-mime tests/sqlite2.kexi still says File "tests/sqlite2.kexi" has a mime-type of application/x-sqlite2 Even though it works in the KDE implementation. It looks like the xdgmime implementation doesn't implement correct resolution of multiple-matching-globs. When multiple mimetypes have the same glob, sniffing should be used, but obviously what is expected then is that sniffing helps choosing among the matching globs, not selecting a completely different mimetype.
Created attachment 19723 [details] sqlite2.kexi test file
After fixing bug 18072, I'm hitting this bug again, with another case: test-template.dot, 'file' test: expected application/msword-template, got application/x-ole-storage This is because *.dot matches both msword-template and text/vnd.graphviz, so sniffing is used, which finds application/x-ole-storage, which should be used to say "ok, so it was msword-template", NOT to just return application/x-ole-storage as the final result. Please fix the xdgmime implementation.
Kexi mimetypes committed. The bug can be seen by the presence of the last 'x' in the lines test-template.dot application/msword-template oxx and in the two kexi lines. But it doesn't matter that much I guess, since Alex Larsson told me that GIO does it right (and KIO does too). It's just a bit strange and confusing that the "reference implementation" would be more buggy than the real-world ones :)
Yes, xdgmime does not implement the spec right here, however its not a huge practical problem because the major user of xdgmime (glib) uses the api in such a way that the mimetype detection works out rightly.
Fixed in 3c8949ec482. This allows to have correct expected results in shared-mime-info's tests/list, now that other implementations share this test suite to ensure maximum interoperability.
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.