quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [patch 6/8] Unmerged patches regenerated against CVS HEAD


From: Gary V. Vaughan
Subject: [Quilt-dev] [patch 6/8] Unmerged patches regenerated against CVS HEAD
Date: Thu, 22 Sep 2005 13:27:06 +0100
User-agent: quilt/0.42-1

 quilt/mail.in |   43 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 34 insertions(+), 9 deletions(-)

Index: quilt-HEAD/quilt/mail.in
===================================================================
--- quilt-HEAD.orig/quilt/mail.in
+++ quilt-HEAD/quilt/mail.in
@@ -21,14 +21,14 @@ fi
 
 usage()
 {
-       printf $"Usage: quilt mail {--mbox file|--send} [--sender ...] [--from 
...] [--to ...] [--cc ...] [--bcc ...] [--subject ...]\n"
+       printf $"Usage: quilt mail {--mbox file|--send} [--sender ...] [--from 
...] [--to ...] [--cc ...] [--bcc ...] [--subject ...] [patch ...]\n"
        if [ x$1 = x-h ]
        then
                printf $"
-Create mail messages from all patches in the series file, and either store
-them in a mailbox file, or send them immediately. The editor is opened
-with a template for the introductory message. Please see the file
-%s for details.
+Create mail messages from all patches in the series file, or the named
+patches (if specified) and either store them in a mailbox file, or send
+them immediately. The editor is opened with a template for the introductory
+message. Please see the file %s for details.
 
 --mbox file
        Store all messages in the specified file in mbox format. The mbox
@@ -132,7 +132,7 @@ do
        esac
 done
 
-if [ $# -gt 0 -o \( -z "$opt_send" -a -z "$opt_mbox" \) ]
+if [ -z "$opt_send" -a -z "$opt_mbox" ]
 then
        usage
 fi
@@ -170,6 +170,15 @@ if [ "$(type -t quilt_mail_patch_filter 
        }
 fi
 
+# Diagnose any misnamed patches
+for name
+do
+        if ! patch=$(find_patch $name)
+       then
+               printf $"Patch %s is not in series\n" "$name" >&2
+               exit 1
+       fi
+done
 introduction=$(gen_tempfile)
 (
        cat <<-EOF
@@ -180,17 +189,33 @@ introduction=$(gen_tempfile)
        To: $(IFS=,; echo "${opt_to[*]}")
        Cc: $(IFS=,; echo "${opt_cc[*]}")
        Bcc: $(IFS=,; echo "${opt_bcc[*]}")
-       Subject-Prefix: [patch @num@/@address@hidden
+       EOF
+       if [ $# -ne 1 ]; then
+               echo 'Subject-Prefix: [patch @num@/@address@hidden'
+       elif [ -z "$opt_subject" ]; then
+               opt_subject=$patch
+       fi
+       cat <<-EOF
        Subject: $opt_subject
 
-       --
        EOF
+       # If there was only one patch specified, it's name will
+       # be in $patch after the misnamed patch check loop above,
+       # and we don't want a separate introduction -- just inline
+       # the patch in the first (and only) message.
+       [ $# -eq 1 ] && cat_file $(patch_file_name $patch) \
+                       | quilt_mail_patch_filter $patch
+       echo "-- "
        [ -r $HOME/.signature ] && cat $HOME/.signature
 ) | @SCRIPTS@/edmail --charset $opt_charset > $introduction
 
 $EDITOR $introduction || exit 1
 
-set -- $(cat_series)
+case $# in
+  0) set -- $(cat_series) ;;
+  1) shift ;;
+  *) ;;
+esac
 total=$#
 
 if [ -n "$opt_mbox" ]; then

--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook




reply via email to

[Prev in Thread] Current Thread [Next in Thread]