1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
Description: Try mimetype first as the generic method for xdg-mime.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33094
Bug-Debian: http://bugs.debian.org/609630
Bug-Debian: http://bugs.debian.org/618624
Author: Per Olofsson <pelle@debian.org>
Author: Scott Ritchie <scottritchie@ubuntu.com>
Index: xdg-utils-1.1.0~rc1/scripts/xdg-mime
===================================================================
--- xdg-utils-1.1.0~rc1.orig/scripts/xdg-mime 2011-03-16 16:26:44.000000000 -0700
+++ xdg-utils-1.1.0~rc1/scripts/xdg-mime 2011-03-28 07:57:17.113065100 -0700
@@ -498,9 +498,15 @@
if gvfs-info --help 2>/dev/null 1>&2; then
DEBUG 1 "Running gvfs-info \"$1\""
gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4
+ elif gnomevfs-info --help 2>/dev/null 1>&2; then
+ DEBUG 1 "Running gnomevfs-info \"$1\""
+ gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
+ elif mimetype --version >/dev/null 2>&1; then
+ DEBUG 1 "Running mimetype -b \"$1\""
+ mimetype -b "$1"
else
- DEBUG 1 "Running gnomevfs-info \"$1\""
- gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
+ DEBUG 1 "Running file -i \"$1\""
+ /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "//
fi
if [ $? -eq 0 ]; then
@@ -512,8 +518,13 @@
info_generic()
{
- DEBUG 1 "Running file -i \"$1\""
- /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "//
+ if mimetype --version >/dev/null 2>&1; then
+ DEBUG 1 "Running mimetype -b \"$1\""
+ mimetype -b "$1"
+ else
+ DEBUG 1 "Running file -i \"$1\""
+ /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "//
+ fi
if [ $? -eq 0 ]; then
exit_success
|