3 # fvwm-bug - 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 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 while test $# -gt 0; do
35 This script is a part of $PACKAGE-$VERSION package.
37 Usage: $script [OPTIONS] [address]
42 address is an alternative email address to send the bug report to;
43 by default, addresses of the local admin or developers are used
47 --version|
-version|
-v|
-V)
52 echo >&2 "Unrecognized option $1 specified."
53 echo >&2 "Run '$0 --help' to get the usage."
57 if test x
"$address" != x
; then
58 echo >&2 "You may specify only one address."
59 echo >&2 "Run '$0 --help' to get the usage."
67 PATH
=/bin
:/usr
/bin
:/usr
/local
/bin
:$PATH
72 TEMP
=`mktemp -q "${TMPDIR:-/tmp}/fvwm-bug.XXXXXX"`
74 # Figure out how to echo a string without a trailing newline
81 trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
82 trap 'rm -f $TEMP $TEMP.x' 0
85 : ${USER:=${LOGNAME:-`whoami`}}
88 if test x
"$address" = x
; then
90 WORKERS
=fvwm-workers@fvwm.org
92 if test "$LOCAL"; then
93 echo "Do you want to send the report to the local maintainer <$LOCAL>,"
94 echo "the fvwm workers <$WORKERS>, or both?"
95 echo $n "Send report to (l)ocal, (w)orkers, (b)oth? " $c
98 l
*|L
*) BUGADDR
=$LOCAL;;
99 f
*|F
*|w
*|W
*) BUGADDR
=$WORKERS;;
100 b
*|B
*) BUGADDR
=$LOCAL,$WORKERS;;
101 *) echo "[Defaulting to LOCAL]"; BUGADDR
=$LOCAL;;
109 if (uname
) >/dev
/null
2>&1; then
113 if [ -f /usr
/lib
/sendmail
] ; then
114 RMAIL
="/usr/lib/sendmail"
115 elif [ -f /usr
/sbin
/sendmail
] ; then
116 RMAIL
="/usr/sbin/sendmail"
123 exec_prefix
=@exec_prefix@
124 datarootdir
=@datarootdir@
126 libexecdir
=@libexecdir@
127 : ${FVWM_USERDIR:=unset}
128 FVWM_DATADIR
=@FVWM_DATADIR@
129 FVWM_MODULEDIR
=@FVWM_MODULEDIR@
135 Subject: [50 character or so descriptive subject here (for reference)]
137 Configuration Information [Automatically generated, do not change]:
139 compiler flags: @CC@ @CFLAGS@
141 FVWM Version: @VERSION@@VERSIONINFO@
142 FVWM_MODULEDIR: $FVWM_MODULEDIR
143 FVWM_DATADIR: $FVWM_DATADIR
144 FVWM_USERDIR: $FVWM_USERDIR
147 [Detailed description of the problem, suggestion, or complaint.]
150 [Describe the sequence of events that causes the problem
154 [Description of how to fix the problem. If you don't know a
155 fix for the problem, don't include this section.]
161 trap '' 2 # ignore interrupts while in editor
163 until $EDITOR $TEMP; do
164 echo "$0: editor \`$EDITOR' exited with nonzero status."
165 echo "$0: Perhaps it was interrupted."
166 echo "$0: Type \`y' to give up, and lose your bug report;"
167 echo "$0: type \`n' to re-enter the editor."
168 echo $n "$0: Do you want to give up? $c"
176 trap 'rm -f $TEMP $TEMP.x; exit 1' 2 # restore trap on SIGINT
178 if cmp -s $TEMP $TEMP.x
180 echo "File not changed, no bug report submitted."
184 echo $n "Send bug report? [y/n] $c"
190 ${RMAIL} $BUGADDR < $TEMP ||
{
191 cat $TEMP >> $HOME/dead.fvwm-bug
192 echo "$0: mail failed: report saved in $HOME/dead.fvwm-bug" >&2