3 # fvwmbug - create a bug report and mail it to the bug address
4 # - adapted from equivalent `bashbug' script
6 # The bug address could depend on the release status of FVWM. Currently
10 PATH
=/bin
:/usr
/bin
:/usr
/local
/bin
:$PATH
17 # Figure out how to echo a string without a trailing newline
24 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
25 trap 'rm -f $TEMP $TEMP.x' 0
28 : ${USER=${LOGNAME-`whoami`}}
31 if test $# -eq 1 ; then
33 elif test $# -eq 0 ; then
35 WORKERS
=fvwm-workers@fvwm.org
37 if test "$LOCAL"; then
38 echo "Do you want to send the report to the local maintainer <$LOCAL>,"
39 echo "the FVWM workers <$WORKERS>, or both?"
40 echo $n "Send report to (l)ocal, (w)orkers, (b)oth? " $c
43 l
*|L
*) BUGADDR
=$LOCAL;;
44 f
*|F
*|w
*|W
*) BUGADDR
=$WORKERS;;
45 b
*|B
*) BUGADDR
=$LOCAL,$WORKERS;;
46 *) echo "[Defaulting to LOCAL]"; BUGADDR
=$LOCAL;;
50 echo >&2 "usage: fvwmbug [address]"
55 if (uname
) >/dev
/null
2>&1; then
59 if [ -f /usr
/lib
/sendmail
] ; then
60 RMAIL
="/usr/lib/sendmail"
61 elif [ -f /usr
/sbin
/sendmail
] ; then
62 RMAIL
="/usr/sbin/sendmail"
69 exec_prefix
=@exec_prefix@
71 libexecdir
=@libexecdir@
72 : ${FVWM_USERDIR=unset}
73 FVWM_DATADIR
=@FVWM_DATADIR@
74 FVWM_MODULEDIR
=@FVWM_MODULEDIR@
80 Subject: [50 character or so descriptive subject here (for reference)]
82 Configuration Information [Automatically generated, do not change]:
84 compiler flags: @CC@ @CFLAGS@
86 FVWM Version: @VERSION@
87 FVWM_MODULEDIR: $FVWM_MODULEDIR
88 FVWM_DATADIR: $FVWM_DATADIR
89 FVWM_USERDIR: $FVWM_USERDIR
92 [Detailed description of the problem, suggestion, or complaint.]
95 [Describe the sequence of events that causes the problem
99 [Description of how to fix the problem. If you don't know a
100 fix for the problem, don't include this section.]
106 trap '' 2 # ignore interrupts while in editor
108 until $EDITOR $TEMP; do
109 echo "$0: editor \`$EDITOR' exited with nonzero status."
110 echo "$0: Perhaps it was interrupted."
111 echo "$0: Type \`y' to give up, and lose your bug report;"
112 echo "$0: type \`n' to re-enter the editor."
113 echo $n "$0: Do you want to give up? $c"
121 trap 'rm -f $TEMP $TEMP.x; exit 1' 2 # restore trap on SIGINT
123 if cmp -s $TEMP $TEMP.x
125 echo "File not changed, no bug report submitted."
129 echo $n "Send bug report? [y/n] $c"
135 ${RMAIL} $BUGADDR < $TEMP ||
{
136 cat $TEMP >> $HOME/dead.fvwmbug
137 echo "$0: mail failed: report saved in $HOME/dead.fvwmbug" >&2