Bug 33094 - mimetype support for xdg-mime (generic)
Summary: mimetype support for xdg-mime (generic)
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0 rc1
Hardware: Other All
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 24930
  Show dependency treegraph
 
Reported: 2011-01-14 01:31 UTC by Per Olofsson
Modified: 2011-04-08 06:59 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
xdg-mime-generic-use-mimetype.diff (644 bytes, patch)
2011-01-14 01:31 UTC, Per Olofsson
Details | Splinter Review
Updated version of the above to work in Gnome (1.82 KB, patch)
2011-03-28 08:19 UTC, Scott Ritchie
Details | Splinter Review

Description Per Olofsson 2011-01-14 01:31:17 UTC
I can't find an existing bug report for this, but anyway. Here's a patch which makes xdg-mime try the mimetype command before file when using the generic method. So that shared-mime-info is used.
Comment 1 Per Olofsson 2011-01-14 01:31:43 UTC
Created attachment 42008 [details] [review]
xdg-mime-generic-use-mimetype.diff
Comment 2 Dan Muresan 2011-01-14 02:44:39 UTC
Good idea. I just found this right after filing #33097...

In short, it's a simple additional change: normalize the path using "readlink -f" at the beginning the info_generic method.
Comment 3 Per Olofsson 2011-01-14 05:05:48 UTC
Ah, thanks! I had forgot about it. I've submitted a patch to 33097 now which dereferences the symlink before calling any method. So applying that patch will make this one work with symlinks as well.
Comment 4 Dan Muresan 2011-01-15 04:09:22 UTC
Thanks! I'm on Ubuntu Lucid (LTS) and had endless problems with Google Chrome and other apps under Fluxbox. With a backported xdg-utils from Ubuntu Maverick plus your two pacthes (slightly adjusted to match), finally these apps behave well even without a desktop environment. I've tested this in my PPA,

https://launchpad.net/~danmbox/+archive/ppa

I guess we'll have to wait for a new xdg-utils in Natty, to be followed by a backport...
Comment 5 Scott Ritchie 2011-03-28 08:19:45 UTC
Created attachment 44936 [details] [review]
Updated version of the above to work in Gnome

The previous patch doesn't run on Gnome systems that have neither gvfs-info or gnomevfs-info installed, which is the case on default Ubuntu Natty.  I have extended it in a straightforward way, and it works :)
Comment 6 Rex Dieter 2011-03-28 09:33:41 UTC
Imo, a default gnome install without either gvfs-info or
gnomevfs-info present is ... not ideal

I guess it won't hurt to add this, but what is this 'mimetype' utility mentioned in the patch?  I'm not familiar with it.
Comment 7 Rex Dieter 2011-03-28 09:34:48 UTC
Ah, corolary to mimeopen, nvm, good! :)


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.