To reproduce run test-mime on a mozilla bookmarks file. It will be detected as
I guess it's because glob has priority over magic and mozilla bookmarks file has
extension .html. If you change the extension it works correctly.
The same probably apply to x-netscape-bookmarks.
I upped the magic here.
It doesnt seem to work yet.
bash-2.05b$ ./test-mime /home/mpeseng/bookmarks.html
File "/home/mpeseng/bookmarks.html" has a mime-type of text/html
As I said this seem to happen because glob matching has priority over magics.
application/x-xbel doesnt have any glob matching, though even adding *.html it
doesnt work correctly. In fact we dont seem to have a way to deal with glob
matching of multiple types, we just use the first match.
Maybe we should fall back to magics if there are multiple glob matches ?
This is a problem in the different implementations, not in shared-mime-info
itself. As Marco said, glob has precedence over magic right now.
The xdgmime implementation behaviour in the presence of multiple matches
has been improved some time ago. Is this still a problem ?
Thanks for your bug report. This wasn't an xdgmime bug, but a shared-mime-info bug. I merged the mozilla and netscape bookmark MIME type definitions, and added glob patterns for this MIME type. It seems to fix the problem for me.
(In reply to comment #5)
> Thanks for your bug report. This wasn't an xdgmime bug, but a shared-mime-info
> bug. I merged the mozilla and netscape bookmark MIME type definitions, and
> added glob patterns for this MIME type. It seems to fix the problem for me.
But why was the extension match added for this MIME-type ? Now xdg_mime_get_mime_type_from_file_name reports _every_ *.html file as a mozilla-bookmark file.
Probably because as said earlier, glob has precedence over magic!