From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx> This script uses an extension to run an external editor from thunderbird that is no-longer maintained. Replace it with a different extension that is maintained[1]. The new extension uses a different separator between the mail headers and message body so update the script to accommodate that. Signed-Off-By: Phillip Wood <phillip.wood@xxxxxxxxxxxxx> [1] https://github.com/Frederick888/external-editor-revived --- Changes since V1: - removed the original definition of SEP (thanks to Junio for pointing that out) contrib/thunderbird-patch-inline/README | 10 +++++----- contrib/thunderbird-patch-inline/appp.sh | 15 ++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/contrib/thunderbird-patch-inline/README b/contrib/thunderbird-patch-inline/README index 000147bbe4a..aa00b379a60 100644 --- a/contrib/thunderbird-patch-inline/README +++ b/contrib/thunderbird-patch-inline/README @@ -1,6 +1,6 @@ -appp.sh is a script that is supposed to be used together with ExternalEditor -for Mozilla Thunderbird. It will let you include patches inline in e-mails -in an easy way. +appp.sh is a script that is supposed to be used together with +ExternalEditorRevived for Mozilla Thunderbird. It will let you include +patches inline in e-mails in an easy way. Usage: - Generate the patch with git format-patch. @@ -14,7 +14,7 @@ will be moved to the section between the --- and the diffstat. All S-O-B:s and Cc:s in the patch will be added to the CC list. -To set it up, just install External Editor and tell it to use appp.sh as the -editor. +To set it up, just install External Editor Revived and tell it to use +appp.sh as the editor. Zenity is a required dependency. diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh index fdcc9483520..c4dd88024bd 100755 --- a/contrib/thunderbird-patch-inline/appp.sh +++ b/contrib/thunderbird-patch-inline/appp.sh @@ -1,14 +1,15 @@ #!/bin/sh # Copyright 2008 Lukas Sandström <luksan@xxxxxxxxx> # -# AppendPatch - A script to be used together with ExternalEditor +# AppendPatch - A script to be used together with ExternalEditorRevived # for Mozilla Thunderbird to properly include patches inline in e-mails. -# ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2 +# ExternalEditorRevived extension can be installed using the Add-ons +# manager in thunderbird, the source is available at +# https://github.com/Frederick888/external-editor-revived CONFFILE=~/.appprc -SEP="-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-" if [ -e "$CONFFILE" ] ; then LAST_DIR=$(grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//') cd "${LAST_DIR}" @@ -25,8 +26,12 @@ fi cd - > /dev/null +# The headers are separated from the message body by a blanks +# line. However the message uses CR LF line ending so on platforms +# where the native line ending is LF we see a line with a single CR. +SEP="$(printf '^\r\\{0,1\\}$')" SUBJECT=$(sed -n -e '/^Subject: /p' "${PATCH}") -HEADERS=$(sed -e '/^'"${SEP}"'$/,$d' $1) +HEADERS=$(sed -e "/${SEP}/"',$d' $1) BODY=$(sed -e "1,/${SEP}/d" $1) CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}") DIFF=$(sed -e '1,/^---$/d' "${PATCH}") @@ -37,7 +42,7 @@ CCS=$(printf '%s\n%s\n' "$CMT_MSG" "$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp echo "$SUBJECT" > $1 echo "Cc: $CCS" >> $1 echo "$HEADERS" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1 -echo "$SEP" >> $1 +echo >> $1 echo "$CMT_MSG" >> $1 echo "---" >> $1 -- 2.49.0.897.gfad3eb7d210