Mercurial > hg > octave-lyh
comparison octave-bug.in @ 2564:ac70da7eeedc
[project @ 1996-12-05 22:36:41 by jwe]
author | jwe |
---|---|
date | Thu, 05 Dec 1996 22:36:41 +0000 |
parents | eda6da293342 |
children | e2f1586bb393 |
comparison
equal
deleted
inserted
replaced
2563:8b0911d576bf | 2564:ac70da7eeedc |
---|---|
57 export PATH | 57 export PATH |
58 | 58 |
59 TEMP=/tmp/octave-bug.$$ | 59 TEMP=/tmp/octave-bug.$$ |
60 | 60 |
61 : ${EDITOR=emacs} | 61 : ${EDITOR=emacs} |
62 : ${PAGER=more} | |
62 | 63 |
63 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15 | 64 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15 |
64 trap 'rm -f $TEMP $TEMP.x' 0 | 65 trap 'rm -f $TEMP $TEMP.x' 0 |
65 | 66 |
66 UN= | 67 UN= |
69 fi | 70 fi |
70 | 71 |
71 HAVE_FMT=false | 72 HAVE_FMT=false |
72 if (fmt < /dev/null) > /dev/null 2>&1; then | 73 if (fmt < /dev/null) > /dev/null 2>&1; then |
73 HAVE_FMT=true | 74 HAVE_FMT=true |
75 fi | |
76 | |
77 # Check whether to use -n or \c to keep echo from printing a newline | |
78 # character. Stolen from autoconf, which borrowed the idea from dist 3.0. | |
79 | |
80 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then | |
81 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. | |
82 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then | |
83 echo_n= | |
84 echo_c=' | |
85 ' | |
86 else | |
87 echo_n=-n | |
88 echo_c= | |
89 fi | |
90 else | |
91 echo_n= | |
92 echo_c='\c' | |
74 fi | 93 fi |
75 | 94 |
76 ss_p=`echo $VERSION | grep "^ss-"` | 95 ss_p=`echo $VERSION | grep "^ss-"` |
77 if test -n "$ss_p"; then | 96 if test -n "$ss_p"; then |
78 BUGADDR="octave-maintainers@bevo.che.wisc.edu" | 97 BUGADDR="octave-maintainers@bevo.che.wisc.edu" |
181 chmod u+w $TEMP | 200 chmod u+w $TEMP |
182 cp $TEMP $TEMP.x | 201 cp $TEMP $TEMP.x |
183 | 202 |
184 status=0 | 203 status=0 |
185 | 204 |
186 if $EDITOR $TEMP; then | 205 editing=true |
206 | |
207 while $editing; do | |
208 if $EDITOR $TEMP; then | |
209 while $editing; do | |
210 echo $echo_n "(a)bort, (e)dit, (l)ist, (s)end? $echo_c" | |
211 read ans | |
212 case "$ans" in | |
213 a* | A*) | |
214 status=1 | |
215 editing=false | |
216 ;; | |
217 e* | E*) | |
218 break; | |
219 ;; | |
220 l* | L*) | |
221 $PAGER $TEMP | |
222 ;; | |
223 s* | S*) | |
224 editing=false | |
225 ;; | |
226 esac | |
227 done | |
228 else | |
229 echo "problems with edit -- no bug report submitted" | |
230 status=1 | |
231 editing=false | |
232 fi | |
233 done | |
234 | |
235 if test $status -eq 0; then | |
187 if cmp -s $TEMP $TEMP.x; then | 236 if cmp -s $TEMP $TEMP.x; then |
188 echo "file not changed -- no bug report submitted" | 237 echo "file not changed -- no bug report submitted" |
189 status=1 | 238 status=1 |
190 elif test `wc $TEMP | awk '{print $1}'` -eq 0; then | 239 elif test `wc $TEMP | awk '{print $1}'` -eq 0; then |
191 echo "empty bug report file -- not submitted" | 240 echo "empty bug report file -- not submitted" |
204 BUGADDR="$TO_ADDR" | 253 BUGADDR="$TO_ADDR" |
205 fi | 254 fi |
206 | 255 |
207 BUGADDR="$BUGADDR $CC_ADDR" | 256 BUGADDR="$BUGADDR $CC_ADDR" |
208 | 257 |
258 TMP_SUB=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^Subject://p'` | |
259 | |
260 if test -n "$TMP_SUB"; then | |
261 SUBJECT="$TMP_SUB" | |
262 fi | |
263 | |
209 # Delete the `--------' separator in the message. | 264 # Delete the `--------' separator in the message. |
210 | 265 |
211 # Don't pretty-print this. Odd whitespace kills Ultrix AWK! | 266 # Don't pretty-print this. Odd whitespace kills Ultrix AWK! |
212 | 267 |
213 awk 'BEGIN{in_header=1;} /^--------[ \t]*$/ { | 268 awk 'BEGIN{in_header=1;} /^--------[ \t]*$/ { |
220 status=$? | 275 status=$? |
221 if test $status -ne 0; then | 276 if test $status -ne 0; then |
222 ( Mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 | 277 ( Mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 |
223 status=$? | 278 status=$? |
224 if test $status -ne 0; then | 279 if test $status -ne 0; then |
225 ( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 | 280 ( /usr/ucb/mail -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 |
226 status=$? | 281 status=$? |
227 if test $status -ne 0; then | 282 if test $status -ne 0; then |
228 ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 | 283 ( mailx -s "$SUBJECT" $BUGADDR < $TEMP.x ) > /dev/null 2>&1 |
229 status=$? | 284 status=$? |
230 fi | 285 fi |
231 fi | 286 fi |
232 fi | 287 fi |
233 | 288 |
234 if test $status -ne 0; then | 289 if test $status -ne 0; then |
235 echo "unable to send mail -- saving message in \$HOME/dead.octave-bug"; | 290 echo "unable to send mail..." |
236 cat $TEMP >> $HOME/dead.octave-bug; | |
237 exit 1 | |
238 else | |
239 echo "bug report sent to: $TO_ADDR" | |
240 echo " cc to: $CC_ADDR" | |
241 fi | 291 fi |
242 fi | 292 fi |
293 fi | |
294 | |
295 if test $status -ne 0; then | |
296 echo "saving message in \$HOME/dead.octave-bug"; | |
297 cat $TEMP >> $HOME/dead.octave-bug; | |
298 exit 1 | |
243 else | 299 else |
244 echo "problems with edit -- no bug report submitted" | 300 echo "bug report sent to: $TO_ADDR" |
245 status=1 | 301 echo " cc to: $CC_ADDR" |
246 fi | 302 fi |
247 | 303 |
248 exit $status | 304 exit $status |