Mercurial > hg > octave-terminal
changeset 2564:ac70da7eeedc
[project @ 1996-12-05 22:36:41 by jwe]
author | jwe |
---|---|
date | Thu, 05 Dec 1996 22:36:41 +0000 |
parents | 8b0911d576bf |
children | 9a1e59a60b56 |
files | ChangeLog octave-bug.in |
diffstat | 2 files changed, 74 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Thu Dec 5 11:05:02 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * octave-bug.in: Prompt for abort, edit, list, or send. + Get subject from message in case it has been edited. + * configure.in: When looking for libf2c, provide definitions for MAIN_ and MAIN__, just in case.
--- a/octave-bug.in +++ b/octave-bug.in @@ -59,6 +59,7 @@ TEMP=/tmp/octave-bug.$$ : ${EDITOR=emacs} +: ${PAGER=more} trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15 trap 'rm -f $TEMP $TEMP.x' 0 @@ -73,6 +74,24 @@ HAVE_FMT=true fi +# Check whether to use -n or \c to keep echo from printing a newline +# character. Stolen from autoconf, which borrowed the idea from dist 3.0. + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + echo_n= + echo_c=' +' + else + echo_n=-n + echo_c= + fi +else + echo_n= + echo_c='\c' +fi + ss_p=`echo $VERSION | grep "^ss-"` if test -n "$ss_p"; then BUGADDR="octave-maintainers@bevo.che.wisc.edu" @@ -183,7 +202,37 @@ status=0 -if $EDITOR $TEMP; then +editing=true + +while $editing; do + if $EDITOR $TEMP; then + while $editing; do + echo $echo_n "(a)bort, (e)dit, (l)ist, (s)end? $echo_c" + read ans + case "$ans" in + a* | A*) + status=1 + editing=false + ;; + e* | E*) + break; + ;; + l* | L*) + $PAGER $TEMP + ;; + s* | S*) + editing=false + ;; + esac + done + else + echo "problems with edit -- no bug report submitted" + status=1 + editing=false + fi +done + +if test $status -eq 0; then if cmp -s $TEMP $TEMP.x; then echo "file not changed -- no bug report submitted" status=1 @@ -206,6 +255,12 @@ BUGADDR="$BUGADDR $CC_ADDR" + TMP_SUB=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^Subject://p'` + + if test -n "$TMP_SUB"; then + SUBJECT="$TMP_SUB" + fi + # Delete the `--------' separator in the message. # Don't pretty-print this. Odd whitespace kills Ultrix AWK! @@ -222,27 +277,28 @@ ( Mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 status=$? if test $status -ne 0; then - ( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 - status=$? - if test $status -ne 0; then - ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 - status=$? - fi + ( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 + status=$? + if test $status -ne 0; then + ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 + status=$? + fi fi fi if test $status -ne 0; then - echo "unable to send mail -- saving message in \$HOME/dead.octave-bug"; - cat $TEMP >> $HOME/dead.octave-bug; - exit 1 - else - echo "bug report sent to: $TO_ADDR" - echo " cc to: $CC_ADDR" + echo "unable to send mail..." fi fi +fi + +if test $status -ne 0; then + echo "saving message in \$HOME/dead.octave-bug"; + cat $TEMP >> $HOME/dead.octave-bug; + exit 1 else - echo "problems with edit -- no bug report submitted" - status=1 + echo "bug report sent to: $TO_ADDR" + echo " cc to: $CC_ADDR" fi exit $status