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

« back to all changes in this revision

Viewing changes to debian/patches/xdg-mime-follow-symlinks.diff

  • Committer: Bazaar Package Importer
  • Author(s): Per Olofsson
  • Date: 2011-02-20 18:34:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110220183453-7p0edr23dygfhseg
Tags: 1.1.0~rc1-2
* Tag patches with upstream bug URLs.
* Add patch xdg-mime-follow-symlinks.diff: Follow symlinks when
  querying MIME type in xdg-mime.
* Add patch xdg-open-browser-multiword.diff: Fix support for multi-word
  $BROWSER commands. Closes: #612339.
* Add patch xdg-open-printf.diff: Use /usr/bin/printf if available when
  decoding URLs. dash's printf doesn't understand \xHH
  sequences. Closes: #613272.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Follow symlinks when querying MIME type in xdg-mime.
 
2
 Otherwise we get stuff like inode/symlink back.
 
3
Author: Per Olofsson <pelle@debian.org>
 
4
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33097
 
5
 
 
6
--- a/scripts/xdg-mime
 
7
+++ b/scripts/xdg-mime
 
8
@@ -495,14 +495,12 @@ info_kde()
 
9
 
 
10
 info_gnome()
 
11
 {
 
12
-    file=`readlink -f "$1"` # Normalize path
 
13
-
 
14
     if gvfs-info --help 2>/dev/null 1>&2; then
 
15
-        DEBUG 1 "Running gvfs-info \"$file\""
 
16
-        gvfs-info "$file" 2> /dev/null | grep standard::content-type | cut -d' ' -f4
 
17
+        DEBUG 1 "Running gvfs-info \"$1\""
 
18
+        gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4
 
19
     else
 
20
-       DEBUG 1 "Running gnomevfs-info \"$file\""
 
21
-       gnomevfs-info --slow-mime "$file" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
 
22
+       DEBUG 1 "Running gnomevfs-info \"$1\""
 
23
+       gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
 
24
     fi
 
25
 
 
26
     if [ $? -eq 0 ]; then
 
27
@@ -751,6 +749,7 @@ case $1 in
 
28
             ;;
 
29
         esac
 
30
         check_input_file "$filename"
 
31
+        filename=$(readlink -f -- "$filename")
 
32
         ;;
 
33
 
 
34
       default)