summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-06-07 00:05:19 +0000
committerdd <dd@FreeBSD.org>2001-06-07 00:05:19 +0000
commitc1faa4bcfff27ff7d1a9775c859bbe2ab8721f83 (patch)
tree4b78897b3d047404092c69fdcc164cbe4bfb6a7f /gnu
parent0e4c21f7c1528eb7a39f52dfa35e17904d47a0cf (diff)
downloadFreeBSD-src-c1faa4bcfff27ff7d1a9775c859bbe2ab8721f83.zip
FreeBSD-src-c1faa4bcfff27ff7d1a9775c859bbe2ab8721f83.tar.gz
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
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/send-pr/send-pr.sh29
1 files 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 309043a..ab2cd11 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,21 +473,33 @@ 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)
#
OpenPOWER on IntegriCloud