From: Charles F. Randall Date: Wed, 18 Jun 1997 00:03:33 +0000 (+1200) Subject: perlbug -ok [PATCH] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b0e3b9e127673a9d73dd5e6394903074e265506;p=p5sagit%2Fp5-mst-13.2.git perlbug -ok [PATCH] Here's a simple patch to perlbug.PL to add an "-ok" option for reporting success. It includes the configuration data from the Config module by forcing the -v option. The resulting subject line on my system is, OK: perl 5.00401 on freebsd 2.1.5-release ^version ^osname ^osvers p5p-msgid: 199706181824.MAA04082@free.click-n-call.com --- diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 4836f3a..d7dfe21 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -49,7 +49,7 @@ use strict; sub paraprint; -my($Version) = "1.17"; +my($Version) = "1.18"; # 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. @@ -69,14 +69,16 @@ my($Version) = "1.17"; # Also report selected environment variables. # Changed in 1.16 to include @INC, and allow user to re-edit if no changes. # Changed in 1.17 Win32 support added. GSAR 97-04-12 +# Changed in 1.18 add '-ok' option for reporting build success. CFR 97-06-18 -# TODO: Allow the user to re-name the file on mail failure, and +# TODO: - Allow the user to re-name the file on mail failure, and # make sure failure (transmission-wise) of Mail::Send is # accounted for. +# - Test -b option my( $file, $usefile, $cc, $address, $perlbug, $testaddress, $filename, $subject, $from, $verbose, $ed, - $fh, $me, $Is_MSWin32, $Is_VMS, $msg, $body, $andcc, %REP); + $fh, $me, $Is_MSWin32, $Is_VMS, $msg, $body, $andcc, %REP, $ok); Init(); @@ -106,7 +108,7 @@ sub Init { $Is_MSWin32 = $^O eq 'MSWin32'; $Is_VMS = $^O eq 'VMS'; - getopts("dhva:s:b:f:r:e:SCc:t"); + getopts("dhva:s:b:f:r:e:SCc:to:"); # This comment is needed to notify metaconfig that we are @@ -117,6 +119,7 @@ sub Init { # perlbug address $perlbug = 'perlbug@perl.com'; + # Test address $testaddress = 'perlbug-test@perl.com'; @@ -124,13 +127,6 @@ sub Init { # Target address $address = $::opt_a || ($::opt_t ? $testaddress : $perlbug); - # Possible administrator addresses, in order of confidence - # (Note that cf_email is not mentioned to metaconfig, since - # we don't really want it. We'll just take it if we have to.) - $cc = ($::opt_C ? "" : ( - $::opt_c || $::Config{perladmin} || $::Config{cf_email} || $::Config{cf_by} - )); - # Users address, used in message and in Reply-To header $from = $::opt_r || ""; @@ -154,7 +150,36 @@ sub Init { ($Is_VMS ? "edit/tpu" : $Is_MSWin32 ? "notepad" : "vi") ); + # OK - send "OK" report for build on this system + $ok = 0; + if ( $::opt_o ) { + if ( $::opt_o eq 'k' ) { + # force these options + $::opt_S = 1; # don't prompt for send + $::opt_C = 1; # don't send a copy to the local admin + $::opt_v = 1; $verbose = 1; + $::opt_s = 1; $subject = "OK: perl $] on " + . $::Config{'osname'} . ' ' + . $::Config{'osvers'}; + $::opt_b = 1; $body = "Perl reported to build OK on this system\n"; + $ok = 1; + } + else { + Help(); + exit(); + } + } + # Possible administrator addresses, in order of confidence + # (Note that cf_email is not mentioned to metaconfig, since + # we don't really want it. We'll just take it if we have to.) + # + # This has to be after the $ok stuff above because of the way + # that $::opt_C is forced. + $cc = ($::opt_C ? "" : ( + $::opt_c || $::Config{perladmin} || $::Config{cf_email} || $::Config{cf_by} + )); + # My username $me = ($Is_MSWin32 ? $ENV{'USERNAME'} : getpwuid($<)); @@ -164,7 +189,7 @@ sub Init { sub Query { # Explain what perlbug is - + if ( ! $ok ) { paraprint <; - chop $from; - - if($from eq "") { $from = $guess } + + if ( $ok && $guess ne '' ) { + # use it + $from = $guess; + } + else { + # verify it + print "Your address [$guess]: "; + + $from = <>; + chop $from; + + if($from eq "") { $from = $guess } + } } @@ -544,6 +580,7 @@ EOF } } + return if $ok; # Check that we have a report that has some, eh, report in it. my $unseen = 0; @@ -768,6 +805,7 @@ Options: -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 -v to get more complete data. + -ok Report successful build on this sytem to perl porters (use alone). -h Print this help message. EOF @@ -803,6 +841,8 @@ S<[ B<-b> I | 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<-h> ]> +B S<[ B<-r> I ]> B<-ok> + =head1 DESCRIPTION A program to help generate bug reports about perl or the modules that @@ -956,6 +996,13 @@ prepared message. Prints a brief summary of the options. +=item B<-ok> + +Report successful build on this system to perl porters. Forces B<-S>, +B<-C>, and B<-v>. Forces and supplies values for B<-s> and B<-b>. Only +prompts for a return address if it cannot guess it (for use with +B). Honors return address specified with B<-r>. + =item B<-r> Your return address. The program will ask you to confirm its default @@ -984,8 +1031,8 @@ Include verbose configuration data in the report. Kenneth Albanowski (Ekjahds@kjahds.comE), subsequently Itored by Gurusamy Sarathy (Egsar@umich.eduE), Tom Christiansen -(Etchrist@perl.comE), and Nathan Torkington -(Egnat@frii.comE). +(Etchrist@perl.comE), Nathan Torkington (Egnat@frii.comE), +and Charles F. Randall (Ecfr@pobox.comE). =head1 SEE ALSO