Subject: bin/24623: patch for send-pr to attach files in the PR
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 03/01/2004 17:32:34
>Number: 24623
>Category: bin
>Synopsis: patch for send-pr to attach files in the PR
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Mar 01 16:33:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Peter Postma
>Release: NetBSD 1.6ZK
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 1.6ZK NetBSD 1.6ZK (mercury) #25: Mon Feb 23 15:42:28 CET 2004 root@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
Request to add support for attachments in send-pr(1).
It makes adding files in the PR a lot easier.
>How-To-Repeat:
>Fix:
Patch taken from FreeBSD:
--- send-pr-attach.diff begins here ---
Index: send-pr.sh
===================================================================
RCS file: /cvsroot/src/gnu/usr.bin/send-pr/send-pr.sh,v
retrieving revision 1.20
diff -u -r1.20 send-pr.sh
--- send-pr.sh 23 Oct 2001 14:29:07 -0000 1.20
+++ send-pr.sh 1 Mar 2004 15:46:15 -0000
@@ -160,8 +160,8 @@
fi
COMMAND=`echo $0 | sed -e 's,.*/,,'`
-USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [--request-id]
-[--version]"
+USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-a file] \
+[--request-id] [--version]"
REMOVE=
BATCH=
@@ -186,6 +186,25 @@
--request-id) REQUEST_ID=true ;;
-h | --help) echo "$USAGE"; exit 0 ;;
-V | --version) echo "$VERSION"; exit 0 ;;
+ -a | --attach) if [ -z "$2" ]; then
+ echo "$USAGE" ; exit 1;
+ fi
+ if [ -e "$2" -a ! -d "$2" ]; then
+ PRETTY_NAME=`basename $2`
+ if file $2 | grep "text" >/dev/null 2>/dev/null ; then
+ ATTACHED_FILES="$ATTACHED_FILES
+--- $PRETTY_NAME begins here ---
+`cat \"$2\"`
+--- $PRETTY_NAME ends here ---
+"
+ else
+ ATTACHED_FILES="$ATTACHED_FILES
+`uuencode \"$PRETTY_NAME\" < \"$2\"`
+"
+ fi
+ shift;
+ fi;
+ ;;
-*) echo "$USAGE" ; exit 1 ;;
*) if [ -z "$USER_GNATS_SITE" ]; then
if [ ! -r "$DATADIR/gnats/$1" ]; then
@@ -318,6 +337,7 @@
if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
cp $PR_FORM $TEMP ||
( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
+ [ -n "$ATTACHED_FILES" ] && echo "$ATTACHED_FILES" >> $TEMP
else
for file in $TEMP $REF ; do
cat > $file << '__EOF__'
@@ -380,6 +400,7 @@
$HOW_TO_REPEAT_C
>Fix:
$FIX_C
+$ATTACHED_FILES
__EOF__
done
fi
Index: send-pr.man
===================================================================
RCS file: /cvsroot/src/gnu/usr.bin/send-pr/send-pr.man,v
retrieving revision 1.7
diff -u -r1.7 send-pr.man
--- send-pr.man 15 Mar 2003 22:04:56 -0000 1.7
+++ send-pr.man 1 Mar 2004 15:46:15 -0000
@@ -35,6 +35,10 @@
.I problem-report
]
[
+.B \-a
+.I file
+]
+[
.B \-t
.I mail-address
]
@@ -120,6 +124,14 @@
.B send-pr
reads from standard input.
.TP
+.BI \-a " file"
+Copy the specified
+.I file
+into the
+.B Fix:
+section.
+Binary files are uuencoded.
+.TP
.BI \-t " mail-address"
Change mail address at the support site for problem reports. The
default
--- send-pr-attach.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted: