[Portland-bugs] [Bug 30449] xdg-mime ought to use shared-mime-info

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jan 6 07:59:26 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=30449

Fathi Boudra <fabo at freedesktop.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fabo at freedesktop.org

--- Comment #5 from Fathi Boudra <fabo at freedesktop.org> 2011-01-06 07:59:26 PST ---
Funny, some days ago I received a mail from Stefan Schneider-Kennedy for
extending 'xdg-mime query filetype' to use fdo.org's shared-mime-info:

> I don't use Gnome or KDE, and hence when performing the 'xdg-mime query
> filetype file.extension' command xdg-mime falls back to the info_generic
> function. I also have the shared-mime-info package (also from
> freedesktop) installed and found it surprising that the command doesn't
> use this if it's available.
> 
> I wrote a short awk script which uses the globs2 list of file extensions
> from shared-mime-info to guess the filetype. This works better than the
> info_generic function in most cases. I haven't used the 'magic numbers'
> file yet, so it won't be able to distinguish, for example, between a file
> called *.pdf and an *actual* PDF file. The 'file' utility (used by info_generic)
> can do this in a number of cases.
> 
> I'm planning on getting it to use the magic numbers (which I believe
> should be possible with standard shell commands), and submitting a
> patch. Before I do so, I thought I'd see if you agree that querying of
> shared-mime-info doesn't belong in the 'file' utility. In my opinion the
> freedesktop.org stuff isn't part of the core utilities of a Unix distribution,
> whereas 'file' is. shared-mime-info's dependence on an XML library would
> also make joining the two less desirable.
> 
> I'm thinking of adding my stuff in as a new function, 'info_shared_mime'
> and placing it higher in the testing priority than info_generic (but
> below KDE and Gnome).

I'm pointing to this bug.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Portland-bugs mailing list