home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
octave-1.1.1p1-bin.lha
/
bin
/
octave-bug
< prev
Wrap
Text File
|
1996-10-12
|
5KB
|
211 lines
#! /bin/sh -
#
# octave-bug - create a bug report and mail it to the bug-octave
# mailing list.
#
# Patterned after the bashbug script from bash 1.14.
#
# John W. Eaton
# jwe@che.utexas.edu
# Department of Chemical Engineering
# The University of Texas at Austin
# Configuration: these variables are filled in at configuration time.
VERSION="1.1.1"
MACHINE="m68k-unknown-amigaos"
F77=""
FFLAGS="-O"
FLIBS="-lf2c"
F2C="f2c"
F2CFLAGS=""
CC="gcc"
CFLAGS="-DHAVE_CONFIG_H -g -O2"
CXX="c++"
CXXFLAGS="-DHAVE_CONFIG_H -fno-implicit-templates -g -O2 -fno-for-scope"
LDFLAGS="-s"
DEFS="-DOCTAVE_SOURCE=1 -DSEPCHAR=':' -DSEPCHAR_STR=":" -DNPSOL_MISSING=1 -DQPSOL_MISSING=1 -DFSQP_MISSING=1 -DHAVE_STRFTIME=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DWORDS_BIGENDIAN=1 -DIEEE_BIG_ENDIAN=1 -DHAVE_ALLOCA=1 -DF77_APPEND_UNDERSCORE=1 -DHAVE_ASSERT_H=1 -DHAVE_FLOAT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PWD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_DIRENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TERMIOS_H=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_GETHOSTNAME=1 -DHAVE_BZERO=1 -DHAVE_BCOPY=1 -DHAVE_RINDEX=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRICMP=1 -DHAVE_STRNICMP=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRERROR=1 -DHAVE_ATEXIT=1 -DHAVE_TEMPNAM=1 -DHAVE_MEMMOVE=1 -DHAVE_PUTENV=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_GETRUSAGE=1 -DHAVE_LIBM=1 -DHAVE_FINITE=1 -DHAVE_ISNAN=1 -DHAVE_ISINF=1 -DHAVE_ACOSH=1 -DHAVE_ASINH=1 -DHAVE_ATANH=1 -DRETSIGTYPE=void -DSYS_SIGLIST_DECLARED=1 -DHAVE_SYS_SIGLIST=1 "
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:$PATH
export PATH
TEMP=/tmp/octave-bug.$$
: ${EDITOR=emacs}
trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
trap 'rm -f $TEMP $TEMP.x' 0
UN=
if (uname) > /dev/null 2>&1
then
UN=`uname -a`
fi
HAVE_FMT=false
if (fmt < /dev/null) > /dev/null 2>&1
then
HAVE_FMT=true
fi
ss_p=`echo $VERSION | grep "^ss-"`
if test -n "$ss_p"
then
BUGADDR="octave-maintainers@che.utexas.edu"
else
BUGADDR="bug-octave@che.utexas.edu"
fi
SUBJECT="[50 character or so descriptive subject here (for reference)]"
if test $# -gt 0
then
case "$1" in
-s)
shift
if test $# -gt 0
then
SUBJECT="$1"
shift
else
echo "usage: octave-bug [-s subject]"
exit 1
fi
;;
esac
fi
cat > $TEMP << EOF
To: $BUGADDR
Subject: $SUBJECT
--------
Bug report for Octave $VERSION configured for $MACHINE
Description:
-----------
* Please replace this item with a detailed description of the
problem. Suggestions or general comments are also welcome.
Repeat-By:
---------
* Please replace this item with a description of the sequence of
events that causes the problem to occur.
Fix:
---
* If possible, replace this item with a description of how to
fix the problem (if you don't have a fix for the problem, don't
include this section, but please do submit your report anyway).
Configuration (please do not edit this section):
-----------------------------------------------
uname output: $UN
Fortran compiler: $F77
FFLAGS: $FFLAGS
F2C: $F2C
F2CFLAGS: $F2CFLAGS
FLIBS: $FLIBS
C compiler: $CC
CFLAGS: $CFLAGS
C++ compiler: $CXX
CXXFLAGS: $CXXFLAGS
LDFLAGS: $LDFLAGS
DEFS:
EOF
if $HAVE_FMT
then
echo $DEFS | fmt | sed 's/^/ /' >> $TEMP
else
echo $DEFS >> $TEMP
fi
if test $# -gt 0
then
if test -f "$1"
then
cat >> $TEMP << EOF
User-preferences (please do not edit this section):
--------------------------------------------------
EOF
cat $1 >> $TEMP
fi
fi
chmod u+w $TEMP
cp $TEMP $TEMP.x
status=0
if $EDITOR $TEMP
then
if cmp -s $TEMP $TEMP.x
then
echo "file not changed -- no bug report submitted"
status=1
else
# Try to extract the recipient address, in case the To: line in the
# message template has been changed. Also get cc: lines.
TO_ADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^[Tt][Oo]://p'`
CC_ADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^[Cc][Cc]://p'`
if test -z "$TO_ADDR"
then
echo "no valid \`To:' field found in header -- using $BUGADDR instead"
else
BUGADDR="$TO_ADDR"
fi
BUGADDR="$BUGADDR $CC_ADDR"
# Delete the `--------' separator in the message.
# Don't pretty-print this. Odd whitespace kills Ultrix AWK!
awk 'BEGIN{in_header=1;} /^--------[ \t]*$/ {
if (in_header) { in_header=0; print ""; next; }
} { print $0; }' $TEMP > $TEMP.x
# Now try to mail it.
( /bin/mail $BUGADDR < $TEMP.x ) > /dev/null 2>&1
status=$?
if test $status -ne 0; then
( 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
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"
fi
fi
else
echo "problems with edit -- no bug report submitted"
status=1
fi
exit $status