~willismonroe/ubuntu/precise/xdg-utils/typo-fix-996304

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