From 217c0f89e3bf9b18b95edec3961c2a970af2f137 Mon Sep 17 00:00:00 2001 From: Dima Dorfman Date: Thu, 7 Jun 2001 00:05:19 +0000 Subject: [PATCH] Don't allow the user to change the subject; instead, always generate it from the Synopsis field. There's no reason for the subject to be different, since all that does is cause confusion. Users may get confused because they may think the subject and synopsis are supposed to be different, and developers may get confused because it may look like there are two different problems. Requested by: ru --- gnu/usr.bin/send-pr/send-pr.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/gnu/usr.bin/send-pr/send-pr.sh b/gnu/usr.bin/send-pr/send-pr.sh index 309043af3cb..ab2cd112a06 100644 --- a/gnu/usr.bin/send-pr/send-pr.sh +++ b/gnu/usr.bin/send-pr/send-pr.sh @@ -285,9 +285,7 @@ SEND-PR: will all comments (text enclosed in `<' and `>'). SEND-PR: SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo SEND-PR: manual if you are not sure how to fill out a problem report. -SEND-PR: Note that the Synopsis field is mandatory. The Subject (for -SEND-PR: the mail) will be made the same as Synopsis unless explicitly -SEND-PR: changed. +SEND-PR: Note that the Synopsis field is mandatory. SEND-PR: SEND-PR: Choose from the following categories: SEND-PR: @@ -307,7 +305,6 @@ __EOF__ cat >> $file << __EOF__ To: $GNATS_ADDR -Subject: From: $FROM Reply-To: $REPLY_TO Cc: $CC @@ -476,20 +473,32 @@ while true; do done # -# Make sure the mail has got a Subject. If not, use the same as -# in Synopsis. +# Remove the subject field if one is already there. There's no reason +# for it to be any different than the synopsis. # - -if grep '^Subject:[ ]*$' $TEMP > /dev/null +if grep '^Subject:' $TEMP > /dev/null then - SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//'` ed -s $TEMP << __EOF__ -/^Subject:/s/:.*\$/: $SYNOPSIS/ +/^Subject:/d w q __EOF__ fi +# +# Add the subject field with the value of $SYNOPSIS. We use the To: +# field as an anchor, which had better be there. +# +SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//' | + sed -e "s;$SYNOPSIS_C;;"` +ed -s $TEMP << __EOF__ +/^To:/a +Subject: $SYNOPSIS +. +w +q +__EOF__ + # # Remove comments and send the problem report # (we have to use patterns, where the comment contains regex chars)