[26472] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25582 - in trunk/athena/bin/sendbug: . debian

daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Thu Jun 14 11:34:08 2012

Date: Thu, 14 Jun 2012 11:34:04 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201206071425.q57EPmhV004480@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1206141128381.18441@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

On Thu, 7 Jun 2012, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2012-06-07 10:25:48 -0400 (Thu, 07 Jun 2012)
> New Revision: 25582
>
> Modified:
>   trunk/athena/bin/sendbug/debian/changelog
>   trunk/athena/bin/sendbug/sendbug.sh
> Log:
> In sendbug:
>  * Make the bug report questions clearer, give the user some guidance on
>    using archaic TTY editors
>
>
> Modified: trunk/athena/bin/sendbug/sendbug.sh
> ===================================================================
> --- trunk/athena/bin/sendbug/sendbug.sh	2012-06-07 00:37:37 UTC (rev 25581)
> +++ trunk/athena/bin/sendbug/sendbug.sh	2012-06-07 14:25:48 UTC (rev 25582)
> @@ -29,7 +29,13 @@
> hostname=$(hostname)
> dpy=$(machtype -d)
>
> +localacct=
> shell=`awk -F: '/^'$USER':/ { print $7; exit; }' /etc/passwd 2>/dev/null`
> +if [ -z "$shell" ]; then
> +    shell=`getent passwd $USER 2>/dev/null | cut -d ':' -f 7`
> +else
> +    localacct="(local account)"
> +fi
> case $shell in
> $SHELL)
>   ;;
> @@ -63,20 +69,27 @@
> Type:			$cpu
> Display type:		$dpy
>
> -Shell:			$shell
> +Shell:			$shell $localacct

I won't complain about the new trailing whitespace for non-local 
accounts.

> Window manager:		${WINDOW_MANAGER:-unknown}
> +Desktop session:	${GDMSESSION:-unknown}
>
> -What were you trying to do?
> -	[Please replace this line with your information.]
> +1) What were you trying to do?
>
> -What's wrong:
> -	[Please replace this line with your information.]
>
> -What should have happened:
> -	[Please replace this line with your information.]
> +2) What happened?
>
> -Please describe any relevant documentation references:
> -	[Please replace this line with your information.]
> +
> +3) What should have happened?
> +
> +
> +4) Does this problem happen only on this workstation, or other workstations?
> +
> +
> +5) If you were following instructions, please include the URL or a
> +   description of the documentation:
> +   (e.g. a "problem set for 18.03" or http://ist.mit.edu)
> +
> +
> EOF
>
> if [ true = "$gnome" ]; then
> @@ -100,19 +113,33 @@
>     text="Thank you for your bug report."
>     zenity --info --text="$text"
>   else
> -    text="Failed to send the bug report!  Please contact x3-4435 for"
> +    text="Failed to send the bug report!  Please contact olc@mit.edu for"
>     text="$text\nassistance.  Your text is in $report_file"
> -    text="$text\nif you wish to recover it."
> +    text="$text\nif you wish to recover it and submit it to $bugs_address"
>     zenity --error --no-wrap --text="$text"
>   fi
> else
> +  : ${EDITOR=nano}

Will this work if there is not already an EDITOR environment variable?
I forget if dash exports all shell variables to the environment or not...

Otherwise, looks good.

-Ben

> +  helpstr=
> +  case "$EDITOR" in
> +    nano|pico)
> +      helpstr="(Ctrl-O, then Enter to save; Ctrl-X to quit after saving)"
> +      ;;
> +    emacs)
> +      helpstr="(Ctrl-X, Ctrl-S to save; Ctrl-X, Ctrl-C to quit after saving)"
> +      ;;
> +  esac
>   fmt << EOF
>
> -Please fill in the specified fields of the bug report form, which will
> -be displayed momentarily.
> -Remember to save the file before exiting the editor.
> +After you press <Enter>, an editor will now open with the bug report
> +form.  Some fields have been filled out already.  Please answer the
> +numbered questions with as much detail as possible.
> +Remember to save the file before exiting the editor.
> +$helpstr
> +
> +Press <Enter> to continue.
> EOF
> -  : ${EDITOR=emacs}
> +  read dummy
>   $EDITOR "$report_file"
>   while true; do
>     fmt << EOF
> @@ -131,8 +158,9 @@
>     echo "Thank you for your bug report."
>   else
>     fmt << EOF
> -Failed to send the bug report!  Please contact x3-4435 for assistance.
> -Your text is in $report_file if you wish to recover it.
> +Failed to send the bug report!  This shouldn't happen!
> +Your text is in $report_file if you wish to recover it,
> +and you can submit it to $bugs_address.
> EOF
>   fi
> fi
>
>

home help back first fref pref prev next nref lref last post