diff --git a/lib/perlbug.t b/lib/perlbug.t index bb6180bcfa..08c34d986d 100644 --- a/lib/perlbug.t +++ b/lib/perlbug.t @@ -69,7 +69,7 @@ like($result, qr/Please use perlbug interactively./, # test -okay (mostly noninteractive) $result = runperl( progfile => $extracted_program, args => ['-okay', '-F', $testreport] ); -like($result, qr/Message saved/, 'build report saved'); +like($result, qr/Report saved/, 'build report saved'); like(_slurp($testreport), qr/Perl reported to build OK on this system/, 'build report looks sane'); unlink $testreport; @@ -82,7 +82,7 @@ $result = runperl( progfile => $extracted_program, '-nokay', '-e', 'file', '-F', $testreport] ); -like($result, qr/Message saved/, 'build failure report saved'); +like($result, qr/Report saved/, 'build failure report saved'); like(_slurp($testreport), qr/This is a build failure report for perl/, 'build failure report looks sane'); unlink $testreport; @@ -104,7 +104,7 @@ $result = runperl( progfile => $extracted_program, '-b', 'testreportbody', '-e', 'file', '-F', $testreport] ); -like($result, qr/Message saved/, 'fake bug report saved'); +like($result, qr/Report saved/, 'fake bug report saved'); my $contents = _slurp($testreport); like($contents, qr/Subject: testingperlbug/, 'Subject included in fake bug report'); @@ -136,7 +136,7 @@ $result = runperl( progfile => $extracted_program, '-p', $attachment, '-e', 'file', '-F', $testreport] ); -like($result, qr/Message saved/, 'fake bug report saved'); +like($result, qr/Report saved/, 'fake bug report saved'); my $contents = _slurp($testreport); unlink $testreport, $body, $attachment; like($contents, qr/Subject: testing perlbug/, diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 8a46b20f14..f78b63c7dd 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -86,14 +86,14 @@ BEGIN { $::HaveWrap = ($@ eq ""); }; -our $VERSION = "1.41"; +our $VERSION = "1.42"; #TODO: # make sure failure (transmission-wise) of Mail::Send is accounted for. # (This may work now. Unsure of the original author's issue -JESSE 2008-06-08) # - Test -b option -my( $file, $usefile, $cc, $address, $bugaddress, $testaddress, $thanksaddress, +my( $file, $usefile, $cc, $address, $thanksaddress, $filename, $messageid, $domain, $subject, $from, $verbose, $ed, $outfile, $fh, $me, $body, $andcc, %REP, $ok, $thanks, $progname, $Is_MSWin32, $Is_Linux, $Is_VMS, $Is_OpenBSD, @@ -122,9 +122,7 @@ EOF Query(); Edit() unless $usefile || ($ok and not $opt{n}); NowWhat(); -if ($outfile) { - save_message_to_disk($outfile); -} else { +if ($address) { Send(); if ($thanks) { print "\nThank you for taking the time to send a thank-you message!\n\n"; @@ -138,12 +136,13 @@ EOF paraprint <ile/ve @@ -866,12 +854,20 @@ EOF } } elsif ($action =~ /^se/i) { # end # Send the message - my $reply = _prompt( "Are you certain you want to send this message?", 'Please type "yes" if you are','no'); + if (not $thanks) { + print <dit, e-edit @@ -902,14 +898,9 @@ sub TrivialSubject { } sub SaveMessage { - my $file_save = $outfile || "$progname.rep"; - my $file = _prompt( '', "Name of file to save message in", $file_save ); + my $file = _prompt( '', "Name of file to save report in", $outfile ); save_message_to_disk($file) || return undef; - print "\n"; - paraprint < $address, Subject => $subject ); + my %headers = ( To => $address || 'perl5-porters@perl.org', Subject => $subject ); $headers{'Cc'} = $cc if ($cc); $headers{'Message-Id'} = $messageid if ($messageid); $headers{'Reply-To'} = $from if ($from); @@ -1134,7 +1125,7 @@ sub save_message_to_disk { print OUTFILE build_complete_message(); close(OUTFILE) or do { warn "Error closing $file: $!"; return undef }; - print "\nMessage saved.\n"; + print "\nReport saved to '$file'. Please submit it to https://github.com/Perl/perl5/issues\n"; return 1; } @@ -1209,9 +1200,9 @@ EOT paraprint(<<"EOF"), die "\n"; $message_start Because of this, there's no easy way to automatically send your -message. +report. -A copy of your message has been saved in '$filename' for you to +A copy of your report has been saved in '$filename' for you to send to '$address' with your normal mail client. EOF } @@ -1271,10 +1262,10 @@ B S<[ B<-v> ]> S<[ B<-a> I
]> S<[ B<-s> I ]> S<[ B<-b> I | B<-f> I ]> S<[ B<-F> I ]> S<[ B<-r> I ]> S<[ B<-e> I ]> S<[ B<-c> I | B<-C> ]> -S<[ B<-S> ]> S<[ B<-t> ]> S<[ B<-d> ]> S<[ B<-A> ]> S<[ B<-h> ]> S<[ B<-T> ]> +S<[ B<-S> ]> S<[ B<-t> ]> S<[ B<-d> ]> S<[ B<-h> ]> S<[ B<-T> ]> B S<[ B<-v> ]> S<[ B<-r> I ]> - S<[ B<-A> ]> S<[ B<-ok> | B<-okay> | B<-nok> | B<-nokay> ]> + S<[ B<-ok> | B<-okay> | B<-nok> | B<-nokay> ]> B @@ -1451,34 +1442,28 @@ if a new version of Perl is released and your bug is still present. =item B<-a> -Address to send the report to. Defaults to B. - -=item B<-A> - -Don't send a bug received acknowledgement to the reply address. -Generally it is only a sensible to use this option if you are a -perl maintainer actively watching perl porters for your message to -arrive. +Address to send the report to instead of saving to a file. =item B<-b> Body of the report. If not included on the command line, or -in a file with B<-f>, you will get a chance to edit the message. +in a file with B<-f>, you will get a chance to edit the report. =item B<-C> -Don't send copy to administrator. +Don't send copy to administrator when sending report by mail. =item B<-c> -Address to send copy of report to. Defaults to the address of the +Address to send copy of report to when sending report by mail. +Defaults to the address of the local perl administrator (recorded when perl was built). =item B<-d> Data mode (the default if you redirect or pipe output). This prints out -your configuration data, without mailing anything. You can use this -with B<-v> to get more complete data. +your configuration data, without saving or mailing anything. You can use +this with B<-v> to get more complete data. =item B<-e> @@ -1487,13 +1472,11 @@ Editor to use. =item B<-f> File containing the body of the report. Use this to quickly send a -prepared message. +prepared report. =item B<-F> -File to output the results to instead of sending as an email. Useful -particularly when running perlbug on a machine with no direct internet -connection. +File to output the results to. Defaults to B. =item B<-h> @@ -1539,17 +1522,16 @@ if you don't use this option. =item B<-S> -Send without asking for confirmation. +Save or send the report without asking for confirmation. =item B<-s> -Subject to include with the message. You will be prompted if you don't +Subject to include with the report. You will be prompted if you don't supply one on the command line. =item B<-t> -Test mode. The target address defaults to B. -Also makes it possible to command perlbug from a pipe or file, for +Test mode. Makes it possible to command perlbug from a pipe or file, for testing purposes. =item B<-T>