Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: third_party/xdg-utils/scripts/xdg-email.in

Issue 6758016: Update xdg-utils to the latest version available in CVS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 #--------------------------------------------- 2 #---------------------------------------------
3 # xdg-email 3 # xdg-email
4 # 4 #
5 # Utility script to open the users favorite email program, using the 5 # Utility script to open the users favorite email program, using the
6 # RFC 2368 mailto: URI spec 6 # RFC 2368 mailto: URI spec
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>
11 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> 12 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
11 # Copyright 2006, Jeremy White <jwhite@codeweavers.com> 13 # Copyright 2006, Jeremy White <jwhite@codeweavers.com>
12 # 14 #
13 # LICENSE: 15 # LICENSE:
14 # 16 #
15 #--------------------------------------------- 17 #---------------------------------------------
16 18
17 manualpage() 19 manualpage()
18 { 20 {
19 cat << _MANUALPAGE 21 cat << _MANUALPAGE
(...skipping 19 matching lines...) Expand all
39 else 41 else
40 MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/') 42 MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/')
41 fi 43 fi
42 44
43 MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g') 45 MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g')
44 TO=$(echo "$MAILTO" | grep '^to=' | sed 's/^to=//' | awk '{ printf "%s,",$0 }') 46 TO=$(echo "$MAILTO" | grep '^to=' | sed 's/^to=//' | awk '{ printf "%s,",$0 }')
45 CC=$(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//' | awk '{ printf "%s,",$0 }') 47 CC=$(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//' | awk '{ printf "%s,",$0 }')
46 BCC=$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//' | awk '{ printf "%s,", $0 }') 48 BCC=$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//' | awk '{ printf "%s,", $0 }')
47 SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1) 49 SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1)
48 BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1) 50 BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1)
49 ATTACH=$(echo "$MAILTO" | sed 's/^attach=/\n\nfile:\/\//g' | awk '/^file:/ { printf "%s,",$0 }') 51 ATTACH=$(echo "$MAILTO" | sed 's/^attach=/\n\nfile:\/\//g' | awk '/^file:/ { printf "%s,",$0 }' | sed 's/,$//')
50 52
51 if [ -z "$TO" ] ; then 53 if [ -z "$TO" ] ; then
52 NEWMAILTO= 54 NEWMAILTO=
53 else 55 else
54 NEWMAILTO="to='$TO'" 56 NEWMAILTO="to='$TO'"
55 fi 57 fi
56 if [ -n "$CC" ] ; then 58 if [ -n "$CC" ] ; then
57 NEWMAILTO="${NEWMAILTO},cc='$CC'" 59 NEWMAILTO="${NEWMAILTO},cc='$CC'"
58 fi 60 fi
59 if [ -n "$BCC" ] ; then 61 if [ -n "$BCC" ] ; then
(...skipping 15 matching lines...) Expand all
75 "$THUNDERBIRD" -compose "$NEWMAILTO" 77 "$THUNDERBIRD" -compose "$NEWMAILTO"
76 if [ $? -eq 0 ]; then 78 if [ $? -eq 0 ]; then
77 exit_success 79 exit_success
78 else 80 else
79 exit_failure_operation_failed 81 exit_failure_operation_failed
80 fi 82 fi
81 } 83 }
82 84
83 open_kde() 85 open_kde()
84 { 86 {
85 local client 87 local client kde_email_profile_name
86 client=`kreadconfig --file emaildefaults --group PROFILE_Default --key Email Client | cut -d ' ' -f 1` 88 kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults -- key Profile`
89 client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile _name" --key EmailClient | cut -d ' ' -f 1`
87 echo $client | grep thunderbird > /dev/null 2>&1 90 echo $client | grep thunderbird > /dev/null 2>&1
88 if [ $? -eq 0 ] ; then 91 if [ $? -eq 0 ] ; then
89 run_thunderbird "$client" "$1" 92 run_thunderbird "$client" "$1"
90 fi 93 fi
91 94
92 if [ -f /etc/SuSE-release ] ; then 95 if [ -f /etc/SuSE-release ] ; then
93 # Workaround for SUSE 10.0 96 # Workaround for SUSE 10.0
94 [ -z "$client" ] && client="kmail" 97 [ -z "$client" ] && client="kmail"
95 if ! which "$client" > /dev/null 2> /dev/null; then 98 if ! which "$client" > /dev/null 2> /dev/null; then
96 DEBUG 3 "KDE has $client configured as email client which isn't inst alled" 99 DEBUG 3 "KDE has $client configured as email client which isn't inst alled"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 linenr = 1 188 linenr = 1
186 } 189 }
187 { 190 {
188 if ( linenr++ != 1 ) { 191 if ( linenr++ != 1 ) {
189 e = e "%0D%0A" 192 e = e "%0D%0A"
190 } 193 }
191 for ( i=1; i<=length ($0); ++i ) { 194 for ( i=1; i<=length ($0); ++i ) {
192 c = substr ($0, i, 1) 195 c = substr ($0, i, 1)
193 if ( ord [c] > 127 ) { 196 if ( ord [c] > 127 ) {
194 e = e "%" sprintf("%02X", ord [c]) 197 e = e "%" sprintf("%02X", ord [c])
195 } else if ( c ~ /[@a-zA-Z0-9.-\\/]/ ) { 198 } else if ( c ~ /[@a-zA-Z0-9.-\\\/]/ ) {
196 e = e c 199 e = e c
197 } else { 200 } else {
198 e = e "%" sprintf("%02X", ord [c]) 201 e = e "%" sprintf("%02X", ord [c])
199 } 202 }
200 } 203 }
201 } 204 }
202 END { 205 END {
203 print e 206 print e
204 } 207 }
205 ') 208 ')
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 ;; 357 ;;
355 358
356 gnome) 359 gnome)
357 open_gnome "${mailto}" 360 open_gnome "${mailto}"
358 ;; 361 ;;
359 362
360 xfce) 363 xfce)
361 open_xfce "${mailto}" 364 open_xfce "${mailto}"
362 ;; 365 ;;
363 366
364 generic) 367 generic|lxde)
365 open_generic "${mailto}" 368 open_generic "${mailto}"
366 ;; 369 ;;
367 370
368 *) 371 *)
369 exit_failure_operation_impossible "no method available for opening '${mailto }'" 372 exit_failure_operation_impossible "no method available for opening '${mailto }'"
370 ;; 373 ;;
371 esac 374 esac
OLDNEW
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-email ('k') | third_party/xdg-utils/scripts/xdg-file-dialog.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698