#!/bin/sh - # # fvwm-bug - create a bug report and mail it to the bug address # - adapted from equivalent `bashbug' script # # The bug address could depend on the release status of fvwm. Currently # it doesn't. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA PACKAGE="@PACKAGE@" VERSION="@VERSION@" script=`basename $0` address="" while test $# -gt 0; do case "$1" in --help|-help|-h|-\?) cat <&2 "Unrecognized option $1 specified." echo >&2 "Run '$0 --help' to get the usage." exit 1 ;; *) if test x"$address" != x; then echo >&2 "You may specify only one address." echo >&2 "Run '$0 --help' to get the usage." exit 1 fi address="$1" ;; esac shift done PATH=/bin:/usr/bin:/usr/local/bin:$PATH export PATH : ${EDITOR:=vi} TEMP=`mktemp -q "${TMPDIR:-/tmp}/fvwm-bug.XXXXXX"` # Figure out how to echo a string without a trailing newline N=`echo 'hi there\c'` case "$N" in *c) n=-n c= ;; *) n= c='\c' ;; esac trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15 trap 'rm -f $TEMP $TEMP.x' 0 # Who is mail from? : ${USER:=${LOGNAME:-`whoami`}} # Who is mail to? if test x"$address" = x; then LOCAL=@LOCAL_BUGADDR@ WORKERS=fvwm-workers@fvwm.org if test "$LOCAL"; then echo "Do you want to send the report to the local maintainer <$LOCAL>," echo "the fvwm workers <$WORKERS>, or both?" echo $n "Send report to (l)ocal, (w)orkers, (b)oth? " $c read ans case "$ans" in l*|L*) BUGADDR=$LOCAL;; f*|F*|w*|W*) BUGADDR=$WORKERS;; b*|B*) BUGADDR=$LOCAL,$WORKERS;; *) echo "[Defaulting to LOCAL]"; BUGADDR=$LOCAL;; esac fi else BUGADDR=$address fi UN= if (uname) >/dev/null 2>&1; then UN=`uname -a` fi if [ -f /usr/lib/sendmail ] ; then RMAIL="/usr/lib/sendmail" elif [ -f /usr/sbin/sendmail ] ; then RMAIL="/usr/sbin/sendmail" else RMAIL=rmail fi prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ datadir=@datadir@ libexecdir=@libexecdir@ : ${FVWM_USERDIR:=unset} FVWM_DATADIR=@FVWM_DATADIR@ FVWM_MODULEDIR=@FVWM_MODULEDIR@ cat > $TEMP <> $HOME/dead.fvwm-bug echo "$0: mail failed: report saved in $HOME/dead.fvwm-bug" >&2 } exit 0