diff options
author | dd <dd@FreeBSD.org> | 2001-06-17 00:35:46 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-06-17 00:35:46 +0000 |
commit | a6546ead98ea3f87804333cb291103d4947f48e5 (patch) | |
tree | 6668efd56bc425fdbaa4b4a28a8c531eef6c6ab6 /gnu | |
parent | e05ff7e2d64783593e0782263ddea331dac375bb (diff) | |
download | FreeBSD-src-a6546ead98ea3f87804333cb291103d4947f48e5.zip FreeBSD-src-a6546ead98ea3f87804333cb291103d4947f48e5.tar.gz |
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
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/send-pr/send-pr.sh | 22 |
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 ab2cd11..8518b58 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 |