quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [patch 7/7] add --select option to mail command


From: martin . quinson
Subject: [Quilt-dev] [patch 7/7] add --select option to mail command
Date: Sat, 21 Dec 2013 21:27:59 +0100
User-agent: quilt/0.61-1

Description:
 .
 When you want to only send out part of a series, this is not
 trivial with quilt. This patch adds a --select option to the
 mail command to allow editing a copy of the series file before
 sending mail so that only those patches you keep in that file
 are sent.
Origin: vendor
Author: Johannes Berg <address@hidden>
Reviewed-by: Martin Quinson <address@hidden>
Last-Update: 2013-08-05
Bug-Debian: http://bugs.debian.org/481331

---
 quilt/mail.in |   30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

Index: b/quilt/mail.in
===================================================================
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -21,7 +21,7 @@
 
 usage()
 {
-       printf $"Usage: quilt mail {--mbox file|--send} [-m text] [-M file] 
[--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] [--bcc ...] 
[--subject ...] [--reply-to message] [first_patch [last_patch]]\n"
+       printf $"Usage: quilt mail {--mbox file|--send} [--select] [-m text] 
[-M file] [--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] 
[--bcc ...] [--subject ...] [--reply-to message] [first_patch [last_patch]]\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -68,6 +68,9 @@
 
 --reply-to message
        Add the appropriate headers to reply to the specified message.
+
+--select
+       Edit a copy of the series file to select patches to send.
 " "@DOCSUBDIR@/README.MAIL"
                exit 0
        else
@@ -165,7 +168,7 @@
 options=`getopt -o m:M:h \
                --long from:,to:,cc:,bcc:,subject: \
                --long send,mbox:,charset:,sender: \
-               --long prefix:,reply-to:,signature: -- "$@"`
+               --long select,prefix:,reply-to:,signature: -- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -223,6 +226,9 @@
        --send)
                opt_send=1
                shift ;;
+       --select)
+               opt_select=1
+               shift ;;
        --mbox)
                opt_mbox=$2
                shift 2 ;;
@@ -262,6 +268,10 @@
 
 if [ $# -ge 1 ]
 then
+       if [ -n "$opt_select" ] ; then
+               echo $"Cannot use --select when specifying the first and last 
patch to work with."
+               exit 1
+       fi
        if [ "$1" = - ]
        then
                first_patch="$(find_first_patch)" || exit 1
@@ -415,6 +425,9 @@
        }
 fi
 
+tmpdir=$(gen_tempfile -d)
+add_exit_handler "rm -rf $tmpdir"
+
 if [ -n "$first_patch" ]
 then
        if [ -n "$last_patch" ]
@@ -436,14 +449,19 @@
        else
                patches=( "$first_patch" $(patches_after "$first_patch") )
        fi
-else
+elif [ -n "$opt_select" ] ; then
+       nser="$tmpdir/series"
+       cp "$SERIES" "$nser"
+       if ! $EDITOR "$nser" ; then
+               exit 1
+       fi
+       SERIES="$nser"
+       patches=( $(cat_series) )
+else   
        patches=( $(cat_series) )
 fi
 address@hidden
 
-tmpdir=$(gen_tempfile -d)
-add_exit_handler "rm -rf $tmpdir"
-
 for patch in "address@hidden"
 do
        mkdir -p "$tmpdir/$(dirname "$patch")"




reply via email to

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