Bug 33094

Summary: mimetype support for xdg-mime (generic)
Product: Portland Reporter: Per Olofsson <pelle>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: danmbox, kjetilho
Version: 1.1.0 rc1   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 24930    
Attachments: xdg-mime-generic-use-mimetype.diff
Updated version of the above to work in Gnome

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.