aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/send-pr
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2001-06-17 00:35:46 +0000
committerDima Dorfman <dd@FreeBSD.org>2001-06-17 00:35:46 +0000
commit8a89f037e99b4548e8dec53efbe1cd3f8b526bed (patch)
tree6668efd56bc425fdbaa4b4a28a8c531eef6c6ab6 /gnu/usr.bin/send-pr
parentb85db196919a926da8a728bd6c5000060470b1d8 (diff)
downloadsrc-8a89f037e99b4548e8dec53efbe1cd3f8b526bed.tar.gz
src-8a89f037e99b4548e8dec53efbe1cd3f8b526bed.zip
Add an -a option which will make send-pr copy the specified file into
the Fix: section. Binary files (as determined by file(1)) are uuencode'd. Submitted by: alex
Notes
Notes: svn path=/head/; revision=78375
Diffstat (limited to 'gnu/usr.bin/send-pr')
-rw-r--r--gnu/usr.bin/send-pr/send-pr.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/gnu/usr.bin/send-pr/send-pr.sh b/gnu/usr.bin/send-pr/send-pr.sh
index ab2cd112a06f..8518b586e34d 100644
--- a/gnu/usr.bin/send-pr/send-pr.sh
+++ b/gnu/usr.bin/send-pr/send-pr.sh
@@ -133,7 +133,7 @@ MACHINE=`[ -f /bin/machine ] && /bin/machine`
COMMAND=`echo $0 | sed -e 's,.*/,,'`
USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
- [-c address] [--version]"
+ [-c address] [-a file] [--version]"
REMOVE=
BATCH=
CC=
@@ -165,6 +165,24 @@ while [ $# -gt 0 ]; do
-l | -CL | --lisp) FORMAT=lisp ;;
-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
+ if file $2 | grep "text" >/dev/null 2>/dev/null ; then
+ ATTACHED_FILES="$ATTACHED_FILES
+--- $2 begins here ---
+`cat \"$2\"`
+--- $2 ends here ---
+"
+ else
+ ATTACHED_FILES="$ATTACHED_FILES
+`uuencode \"$2\" < \"$2\"`
+"
+ fi
+ shift;
+ fi;
+ ;;
-*) echo "$USAGE" ; exit 1 ;;
*) if [ -z "$USER_GNATS_SITE" ]; then
if [ ! -r "$DATADIR/gnats/$1" ]; then
@@ -334,6 +352,8 @@ X-GNATS-Notify:
>Fix:
$FIX_C
+$ATTACHED_FILES
+
__EOF__
done