From: Perl 5 Porters Date: Tue, 16 Jul 1996 22:25:08 +0000 (+0000) Subject: perl 5.003_01: utils/perlbug.PL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab3ef367c12296c23c68a0fbe009c01d848957fa;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_01: utils/perlbug.PL More informative prompting Don't edit precomposed file Correct socket %Config variable under VMS Try again if we can't read precomposed file Be more finicky about command to send message --- diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 7a74c9f..9527025 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -50,7 +50,7 @@ use strict; sub paraprint; -my($Version) = "1.13"; +my($Version) = "1.14"; # Changed in 1.06 to skip Mail::Send and Mail::Util if not available. # Changed in 1.07 to see more sendmail execs, and added pipe output. @@ -64,12 +64,14 @@ my($Version) = "1.13"; # clearer and add $ENV{REPLYTO}. # Changed in 1.13 to hopefully make it more difficult to accidentally # send mail +# Changed in 1.14 to make the prompts a little more clear on providing +# helpful information. Also let file read fail gracefully. # TODO: Allow the user to re-name the file on mail failure, and # make sure failure (transmission-wise) of Mail::Send is # accounted for. -my( $file, $cc, $address, $perlbug, $testaddress, $filename, +my( $file, $usefile, $cc, $address, $perlbug, $testaddress, $filename, $subject, $from, $verbose, $ed, $fh, $me, $Is_VMS, $msg, $body, $andcc ); @@ -88,7 +90,7 @@ EOF if($::opt_d or !-t STDOUT) { Dump(*STDOUT); exit; } Query(); -Edit(); +Edit() unless $usefile; NowWhat(); Send(); @@ -134,6 +136,9 @@ sub Init { # Subject of bug-report message $subject = $::opt_s || ""; + # Send a file + $usefile = ($::opt_f || 0); + # File to send as report $file = $::opt_f || ""; @@ -141,10 +146,10 @@ sub Init { $body = $::opt_b || ""; # Editor - $ed = ($::opt_f ? "file" : ( - $::opt_e || $ENV{VISUAL} || $ENV{EDITOR} || $ENV{EDIT} || + $ed = ( $::opt_e || $ENV{VISUAL} || $ENV{EDITOR} || $ENV{EDIT} || ($Is_VMS ? "edit/tpu" : "vi") - )); + ); + # My username $me = getpwuid($<); @@ -157,9 +162,8 @@ sub Query { # Explain what perlbug is paraprint <); chop $entry; - - if($entry ne "") { + + $usefile = 0; + if($entry eq "file") { + $usefile = 1; + } elsif($entry ne "") { $ed = $entry; } } @@ -328,10 +343,10 @@ EOF # Prompt for file to read report from, if needed - if( $ed eq "file" and ! $file) { + if( $usefile and ! $file) { +filename: paraprint <); chop($entry); + if($entry eq "") { + paraprint <) { print REP $_ } @@ -407,9 +437,26 @@ EOF sub Edit { # Edit the report + + if($usefile) { + $usefile = 0; + paraprint <); + chop $entry; -tryagain: - if(!$file and !$body) { + if($entry ne "") { + $ed = $entry; + } + } + +tryagain: + if(!$usefile and !$body) { my($sts) = system("$ed $filename"); if( $Is_VMS ? !($sts & 1) : $sts ) { #print "\nUnable to run editor!\n"; @@ -493,6 +540,15 @@ Please type \"yes\" if you are: "; chop($reply); if( $reply eq "yes" ) { last; + } else { + paraprint <dit, e-edit # edit the message