OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-mime | 3 # xdg-mime |
4 # | 4 # |
5 # Utility script to manipulate MIME related information | 5 # Utility script to manipulate MIME related information |
6 # on XDG compliant systems. | 6 # on XDG compliant systems. |
7 # | 7 # |
8 # Refer to the usage() function below for usage. | 8 # Refer to the usage() function below for usage. |
9 # | 9 # |
10 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> | 10 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 exit_failure_operation_failed | 90 exit_failure_operation_failed |
91 fi | 91 fi |
92 } | 92 } |
93 | 93 |
94 info_generic() | 94 info_generic() |
95 { | 95 { |
96 if mimetype --version >/dev/null 2>&1; then | 96 if mimetype --version >/dev/null 2>&1; then |
97 DEBUG 1 "Running mimetype -b \"$1\"" | 97 DEBUG 1 "Running mimetype -b \"$1\"" |
98 mimetype -b "$1" | 98 mimetype -b "$1" |
99 else | 99 else |
100 DEBUG 1 "Running file -i \"$1\"" | 100 DEBUG 1 "Running file --mime-type \"$1\"" |
101 /usr/bin/file -i "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^ "// | 101 /usr/bin/file --mime-type "$1" 2> /dev/null | cut -d ":" -f 2 | sed s/"^
"// |
102 fi | 102 fi |
103 | 103 |
104 if [ $? -eq 0 ]; then | 104 if [ $? -eq 0 ]; then |
105 exit_success | 105 exit_success |
106 else | 106 else |
107 exit_failure_operation_failed | 107 exit_failure_operation_failed |
108 fi | 108 fi |
109 } | 109 } |
110 | 110 |
111 make_default_kde() | 111 make_default_kde() |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 rm -f $kde_dir/$x.desktop | 862 rm -f $kde_dir/$x.desktop |
863 fi | 863 fi |
864 done | 864 done |
865 ;; | 865 ;; |
866 esac | 866 esac |
867 | 867 |
868 update_mime_database $xdg_base_dir | 868 update_mime_database $xdg_base_dir |
869 | 869 |
870 exit_success | 870 exit_success |
871 | 871 |
OLD | NEW |