while (<PATCH_LEVEL>) {
last if /^\s*}/;
next if /^\s*#/; # preprocessor stuff
+ next if /PERL_GIT_UNPUSHED_COMMITS/; # XXX expand instead
+ next if /"uncommitted-changes"/; # XXX determine if active instead
chomp;
s/^\s+,?\s*"?//;
s/"?\s*,?$//;
my( $file, $usefile, $cc, $address, $bugaddress, $testaddress, $thanksaddress,
$filename, $messageid, $domain, $subject, $from, $verbose, $ed, $outfile,
$fh, $me, $body, $andcc, %REP, $ok, $thanks, $progname,
- $Is_MacOS, $Is_MSWin32, $Is_Linux, $Is_VMS, $Is_OpenBSD,
+ $Is_MSWin32, $Is_Linux, $Is_VMS, $Is_OpenBSD,
$report_about_module, $category, $severity,
);
save_message_to_disk($outfile);
} else {
Send();
- print "\nThank you for taking the time to file a bug report!\n\n";
+ if ($thanks) {
+ print "\nThank you for taking the time to send a thank-you message!\n\n";
+ } else {
+ print "\nThank you for taking the time to file a bug report!\n\n";
+ }
}
exit;
$Is_VMS = $^O eq 'VMS';
$Is_Linux = lc($^O) eq 'linux';
$Is_OpenBSD = lc($^O) eq 'openbsd';
- $Is_MacOS = $^O eq 'MacOS';
-
- @ARGV = split m/\s+/,
- MacPerl::Ask('Provide command line args here (-h for help):')
- if $Is_MacOS && $MacPerl::Version =~ /App/;
if (!getopts("Adhva:s:b:f:F:r:e:SCc:to:n:T")) { Help(); exit; };
$address = $::opt_a || ($::opt_t ? $testaddress
: $thanks ? $thanksaddress : $bugaddress);
- # Users address, used in message and in Reply-To header
+ # Users address, used in message and in From and Reply-To headers
$from = $::opt_r || "";
# Include verbose configuration information
$ed = $::opt_e || $ENV{VISUAL} || $ENV{EDITOR} || $ENV{EDIT}
|| ($Is_VMS && "edit/tpu")
|| ($Is_MSWin32 && "notepad")
- || ($Is_MacOS && '')
|| "vi";
# Not OK - provide build failure template by finessing OK report
# My username
$me = $Is_MSWin32 ? $ENV{'USERNAME'}
: $^O eq 'os2' ? $ENV{'USER'} || $ENV{'LOGNAME'}
- : $Is_MacOS ? $ENV{'USER'}
: eval { getpwuid($<) }; # May be missing
$from = $::Config{'cf_email'}
}
# Prompt for return address, if needed
- unless ($from) {
+ unless ($::opt_r) {
# Try and guess return address
my $guess;
- $guess = $ENV{'REPLY-TO'} || $ENV{'REPLYTO'} || '';
- if ($Is_MacOS) {
- require Mac::InternetConfig;
- $guess = $Mac::InternetConfig::InternetConfig{
- Mac::InternetConfig::kICEmail()
- };
- }
+ $guess = $ENV{'REPLY-TO'} || $ENV{'REPLYTO'} || $ENV{'EMAIL'}
+ || $from || '';
unless ($guess) {
# move $domain to where we can use it elsewhere
EOF
$entry = '';
+ } elsif (my $bug_tracker = $Module::CoreList::bug_tracker{$entry}) {
+ paraprint <<"EOF";
+$entry included with core Perl is copied directly from the CPAN distribution.
+Please report bugs in $entry directly to its maintainers using $bug_tracker
+EOF
+ $entry = '';
} elsif ($entry) {
$category ||= 'library';
$report_about_module = $entry;
sub Dump {
local(*OUT) = @_;
+ # these won't have been set if run with -d
+ $category ||= 'core';
+ $severity ||= 'low';
+
print OUT <<EFF;
---
Flags:
my $value;
foreach (sort keys %::Config) {
$value = $::Config{$_};
+ $value = '' unless defined $value;
$value =~ s/'/\\'/g;
print OUT "$_='$value'\n";
}
my $report_written = 0;
while ( !$report_written ) {
- if ($Is_MacOS) {
- require ExtUtils::MakeMaker;
- ExtUtils::MM_MacOS::launch_file($filename);
- _prompt('', "Press Enter when done." );
- } else { # we're not on oldschool mac os
- my $exit_status = system("$editor $filename");
- if ($exit_status) {
- my $desc = <<EOF;
+ my $exit_status = system("$editor $filename");
+ if ($exit_status) {
+ my $desc = <<EOF;
The editor you chose ('$editor') could not be run!
If you mistyped its name, please enter it now, otherwise just press Enter.
EOF
- my $entry = _prompt( $desc, 'Editor', $editor );
- if ( $entry ne "" ) {
- $editor = $entry;
- next;
- } else {
- paraprint <<EOF;
+ my $entry = _prompt( $desc, 'Editor', $editor );
+ if ( $entry ne "" ) {
+ $editor = $entry;
+ next;
+ } else {
+ paraprint <<EOF;
You may want to save your report to a file, so you can edit and
mail it later.
EOF
- return;
- }
+ return;
}
}
return if ( $ok and not $::opt_n ) || $body;
You have finished composing your message. At this point, you have
a few options. You can:
- * [Se]end the message to $address$andcc,
+ * [Se]nd the message to $address$andcc,
* [D]isplay the message on the screen,
* [R]e-edit the message
* Display or change the message's [su]bject
$headers{'Cc'} = $cc if ($cc);
$headers{'Message-Id'} = $messageid if ($messageid);
$headers{'Reply-To'} = $from if ($from);
+ $headers{'From'} = $from if ($from);
return \%headers;
}
open(REP, "<$filename") or die "Couldn't open '$filename': $!\n";
while (<REP>) { print $fh $_ }
close(REP) or die "Error closing $filename: $!";
- $fh->close;
+ $fh->close or die "Error sending mail: $!";
print "\nMessage sent.\n";
}
sub _send_message_sendmail {
my $sendmail = _probe_for_sendmail();
unless ($sendmail) {
- paraprint(<<"EOF"), die "\n";
+ my $message_start = !$Is_Linux && !$Is_OpenBSD ? <<'EOT' : <<'EOT';
It appears that there is no program which looks like "sendmail" on
your system and that the Mail::Send library from CPAN isn't available.
+EOT
+It appears that there is no program which looks like "sendmail" on
+your system.
+EOT
+ paraprint(<<"EOF"), die "\n";
+$message_start
Because of this, there's no easy way to automatically send your
message.
EOF
}
- open( SENDMAIL, "|$sendmail -t -oi" )
- || die "'|$sendmail -t -oi' failed: $!";
+ open( SENDMAIL, "|-", $sendmail, "-t", "-oi", "-f", $from )
+ || die "'|$sendmail -t -oi -f $from' failed: $!";
print SENDMAIL build_complete_message();
if ( close(SENDMAIL) ) {
print "\nMessage sent\n";
S<[ B<-b> I<body> | B<-f> I<inputfile> ]> S<[ B<-F> I<outputfile> ]>
S<[ B<-r> I<returnaddress> ]>
S<[ B<-e> I<editor> ]> S<[ B<-c> I<adminaddress> | B<-C> ]>
-S<[ B<-S> ]> S<[ B<-t> ]> S<[ B<-d> ]> S<[ B<-A> ]> S<[ B<-h> ]>
+S<[ B<-S> ]> S<[ B<-t> ]> S<[ B<-d> ]> S<[ B<-A> ]> S<[ B<-h> ]> S<[ B<-T> ]>
B<perlbug> S<[ B<-v> ]> S<[ B<-r> I<returnaddress> ]>
S<[ B<-A> ]> S<[ B<-ok> | B<-okay> | B<-nok> | B<-nokay> ]>
+B<perlthanks>
+
=head1 DESCRIPTION
volunteers who build and maintain Perl than reports about bugs in
the current release.
-This tool isn't apropriate for reporting bugs in any version
+This tool isn't appropriate for reporting bugs in any version
prior to Perl 5.0.
=item Are you sure what you have is a bug?
=item Do you have a proper test case?
The easier it is to reproduce your bug, the more likely it will be
-fixed -- if nobody can duplicate your problem, it probably won't be
+fixed -- if nobody can duplicate your problem, it probably won't be
addressed.
A good test case has most of these attributes: short, simple code;
is "perl crashes" nor is "HELP!!!". These don't help. A compact
description of what's wrong is fine.
+=item Can you use C<perlbug> to submit a thank-you note?
+
+Yes, you can do this by either using the C<-T> option, or by invoking
+the program as C<perlthanks>. Thank-you notes are good. It makes people
+smile.
+
=back
Having done your bit, please be prepared to wait, to be told the
Test mode. The target address defaults to B<perlbug-test@perl.org>.
+=item B<-T>
+
+Send a thank-you note instead of a bug report.
+
=item B<-v>
Include verbose configuration data in the report.