Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jun 2001 16:27:48 -0700
From:      Dima Dorfman <dima@unixfreak.org>
To:        ru@freebsd.org
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/gnu/usr.bin/send-pr send-pr.sh 
Message-ID:  <20010604232748.98E913E28@bazooka.unixfreak.org>
In-Reply-To: <20010604180653.B43094@sunbay.com>; from ru@FreeBSD.org on "Mon, 4 Jun 2001 18:06:53 %2B0300"

next in thread | previous in thread | raw e-mail | index | archive | help
Ruslan Ermilov <ru@FreeBSD.org> writes:
> On Mon, Jun 04, 2001 at 07:48:39AM -0700, David O'Brien wrote:
> > On Mon, Jun 04, 2001 at 01:43:06PM +0300, Ruslan Ermilov wrote:
> > > Can we please also remove Subject: from the list of changeable headers?
> > 
> > Agreed.  Can we automagically create the subject as a copy of the
> > Synopsis line?
> > 
> It's already constructed automatically if empty.  What I want is to just
> disallow changing it from its default (Synopsis-derived) value.

I think this is a good idea.  There's no reason for the subject to be
different than the synopsis; all that does is serve to confuse whoever
is trying to decide what to do with the PR.  I've attached a patch
which makes send-pr unconditionally write the subject itself.  Please
review.

Thanks,

					Dima Dorfman
					dima@unixfreak.org

Index: send-pr.sh
===================================================================
RCS file: /stl/src/FreeBSD/src/gnu/usr.bin/send-pr/send-pr.sh,v
retrieving revision 1.23
diff -u -r1.23 send-pr.sh
--- send-pr.sh	2001/06/03 02:40:37	1.23
+++ send-pr.sh	2001/06/04 23:24:59
@@ -285,9 +285,7 @@
 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 @@
 
       cat >> $file << __EOF__
 To: $GNATS_ADDR
-Subject: 
 From: $FROM
 Reply-To: $REPLY_TO
 Cc: $CC
@@ -476,19 +473,31 @@
 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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010604232748.98E913E28>