diff --git a/bin/corelist b/bin/corelist index 30520dca..eaaf4de1 100755 --- a/bin/corelist +++ b/bin/corelist @@ -352,10 +352,10 @@ sub module_version { print $msg,"\n"; if( defined $ret and exists $Opts{u} ) { - my $upsream = $Module::CoreList::upstream{$mod}; - $upsream = 'undef' unless $upsream; - print "upstream: $upsream\n"; - if ( $upsream ne 'blead' ) { + my $upstream = $Module::CoreList::upstream{$mod}; + $upstream = 'undef' unless $upstream; + print "upstream: $upstream\n"; + if ( $upstream ne 'blead' ) { my $bugtracker = $Module::CoreList::bug_tracker{$mod}; $bugtracker = 'unknown' unless $bugtracker; print "bug tracker: $bugtracker\n"; diff --git a/bin/cpan b/bin/cpan index 91031a5f..9ca1d6e8 100755 --- a/bin/cpan +++ b/bin/cpan @@ -7,8 +7,8 @@ BEGIN { pop @INC if $INC[-1] eq '.' } use strict; use vars qw($VERSION); -use App::Cpan '1.60_02'; -$VERSION = '1.61'; +use App::Cpan '1.64'; +$VERSION = '1.64'; my $rc = App::Cpan->run( @ARGV ); @@ -25,7 +25,13 @@ cpan - easily interact with CPAN from the command line cpan module_name [ module_name ... ] # with switches, installs modules with extra behavior - cpan [-cfgimtTw] module_name [ module_name ... ] + cpan [-cfFimtTw] module_name [ module_name ... ] + + # use local::lib + cpan -I module_name [ module_name ... ] + + # one time mirror override for faster mirrors + cpan -p ... # with just the dot, install from the distribution in the # current directory @@ -34,20 +40,8 @@ cpan - easily interact with CPAN from the command line # without arguments, starts CPAN.pm shell cpan - # force install modules (usually those that fail tests) - cpan -f module_name [ module_name ... ] - - # install modules but without testing them - cpan -T module_name [ module_name ... ] - - # dump the configuration - cpan -J - - # load a different configuration to install Module::Foo - cpan -j some/other/file Module::Foo - # without arguments, but some switches - cpan [-ahrvACDlLO] + cpan [-ahpruvACDLOPX] =head1 DESCRIPTION @@ -77,7 +71,10 @@ Show the F files for the specified modules =item -D module [ module ... ] -Show the module details. +Show the module details. This prints one line for each out-of-date module +(meaning, modules locally installed but have newer versions on CPAN). +Each line has three columns: module name, local version, and CPAN +version. =item -f @@ -114,13 +111,15 @@ distribution. Print a help message and exit. When you specify C<-h>, it ignores all of the other options and arguments. -=item -i +=item -i module [ module ... ] -Install the specified modules. +Install the specified modules. With no other switches, this switch +is implied. =item -I -Load C (think like C<-I> for loading lib paths). +Load C (think like C<-I> for loading lib paths). Too bad +C<-l> was already taken. =item -j Config.pm @@ -146,23 +145,38 @@ List the modules by the specified authors. Make the specified modules. +=item -M mirror1,mirror2,... + +A comma-separated list of mirrors to use for just this run. The C<-P> +option can find them for you automatically. + +=item -n + +Do a dry run, but don't actually install anything. (unimplemented) + =item -O Show the out-of-date modules. =item -p -Ping the configured mirrors +Ping the configured mirrors and print a report =item -P -Find the best mirrors you could be using (but doesn't configure them just yet) +Find the best mirrors you could be using and use them for the current +session. =item -r Recompiles dynamically loaded modules with CPAN::Shell->recompile. -=item -t +=item -s + +Drop in the CPAN.pm shell. This command does this automatically if you don't +specify any arguments. + +=item -t module [ module ... ] Run a `make test` on the specified modules. @@ -190,6 +204,16 @@ UNIMPLEMENTED Turn on cpan warnings. This checks various things, like directory permissions, and tells you about problems you might have. +=item -x module [ module ... ] + +Find close matches to the named modules that you think you might have +mistyped. This requires the optional installation of Text::Levenshtein or +Text::Levenshtein::Damerau. + +=item -X + +Dump all the namespaces to standard output. + =back =head2 Examples @@ -215,9 +239,10 @@ and tells you about problems you might have. # force install modules ( must use -i ) cpan -fi CGI::Minimal URI -=head1 ENVIRONMENT VARIABLES + # install modules but without testing them + cpan -Ti CGI::Minimal URI -=over 4 +=head2 Environment variables There are several components in CPAN.pm that use environment variables. The build tools, L and L use some, @@ -230,11 +255,21 @@ Oslo Concensus: L sets this to C<1> unless it already +has a value (even if that value is false). + +=item PERL_MM_USE_DEFAULT + +Use the default answer for a prompted questions. C sets this +to C<1> unless it already has a value (even if that value is false). + =item CPAN_OPTS -C splits this variable on whitespace and prepends that list to C<@ARGV> -before it processes the command-line arguments. For instance, if you always -want to use C, you can set C to C<-I>. +As with C, a string of additional C options to +add to those you specify on the command line. =item CPANSCRIPT_LOGLEVEL @@ -248,19 +283,6 @@ C, and C. The default is C. The path to the C binary to use for the Git features. The default is C. -=item NONINTERACTIVE_TESTING - -Assume no one is paying attention and skips prompts for distributions -that do that correctly. C sets this to C<1> unless it already -has a value (even if that value is false). - -=item PERL_MM_USE_DEFAULT - -Use the default answer for a prompted questions. C sets this -to C<1> unless it already has a value (even if that value is false). - -=back - =back =head1 EXIT VALUES @@ -316,7 +338,7 @@ brian d foy, C<< >> =head1 COPYRIGHT -Copyright (c) 2001-2014, brian d foy, All Rights Reserved. +Copyright (c) 2001-2015, brian d foy, All Rights Reserved. You may redistribute this under the same terms as Perl itself. diff --git a/bin/enc2xs b/bin/enc2xs index bf6646fe..6e904860 100755 --- a/bin/enc2xs +++ b/bin/enc2xs @@ -14,7 +14,7 @@ use warnings; use Getopt::Std; use Config; my @orig_ARGV = @ARGV; -our $VERSION = do { my @r = (q$Revision: 2.18 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 2.20 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # These may get re-ordered. # RAW is a do_now as inserted by &enter @@ -126,7 +126,10 @@ my %encode_types = (U => \&encode_U, ); # Win32 does not expand globs on command line -eval "\@ARGV = map(glob(\$_),\@ARGV)" if ($^O eq 'MSWin32'); +if ($^O eq 'MSWin32' and !$ENV{PERL_CORE}) { + eval "\@ARGV = map(glob(\$_),\@ARGV)"; + @ARGV = @orig_ARGV unless @ARGV; +} my %opt; # I think these are: @@ -137,6 +140,8 @@ my %opt; # -o to specify the output file name (else it's the first arg) # -f to give a file with a list of input files (else use the args) # -n to name the encoding (else use the basename of the input file. +#Getopt::Long::Configure("bundling"); +#GetOptions(\%opt, qw(C M=s S Q q O o=s f=s n=s v)); getopts('CM:SQqOo:f:n:v',\%opt); $opt{M} and make_makefile_pl($opt{M}, @ARGV); @@ -199,9 +204,9 @@ sub compiler_info { # This really should go first, else the die here causes empty (non-erroneous) # output files to be written. my @encfiles; -if (exists $opt{'f'}) { +if (exists $opt{f}) { # -F is followed by name of file containing list of filenames - my $flist = $opt{'f'}; + my $flist = $opt{f}; open(FLIST,$flist) || die "Cannot open $flist:$!"; chomp(@encfiles = ); close(FLIST); @@ -209,9 +214,15 @@ if (exists $opt{'f'}) { @encfiles = @ARGV; } -my $cname = (exists $opt{'o'}) ? $opt{'o'} : shift(@ARGV); +my $cname = $opt{o} ? $opt{o} : shift(@ARGV); +unless ($cname) { #debuging a win32 nmake error-only. works via cmdline + print "\nARGV:"; + print "$_ " for @ARGV; + print "\nopt:"; + print " $_ => ",defined $opt{$_}?$opt{$_}:"undef","\n" for keys %opt; +} chmod(0666,$cname) if -f $cname && !-w $cname; -open(C,">$cname") || die "Cannot open $cname:$!"; +open(C,">", $cname) || die "Cannot open $cname:$!"; my $dname = $cname; my $hname = $cname; @@ -223,10 +234,10 @@ if ($cname =~ /\.(c|xs)$/i) # VMS may have upcased filenames with DECC$ARGV_PARS $doC = 1; $dname =~ s/(\.[^\.]*)?$/.exh/; chmod(0666,$dname) if -f $cname && !-w $dname; - open(D,">$dname") || die "Cannot open $dname:$!"; + open(D,">", $dname) || die "Cannot open $dname:$!"; $hname =~ s/(\.[^\.]*)?$/.h/; chmod(0666,$hname) if -f $cname && !-w $hname; - open(H,">$hname") || die "Cannot open $hname:$!"; + open(H,">", $hname) || die "Cannot open $hname:$!"; foreach my $fh (\*C,\*D,\*H) { @@ -472,7 +483,9 @@ sub compile_ucm $erep = $attr{'subchar'}; $erep =~ s/^\s+//; $erep =~ s/\s+$//; } - print "Reading $name ($cs)\n"; + print "Reading $name ($cs)\n" + unless defined $ENV{MAKEFLAGS} + and $ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/; my $nfb = 0; my $hfb = 0; while (<$fh>) @@ -758,9 +771,17 @@ sub addstrings if ($a->{'Forward'}) { my ($cpp, $static, $sized) = compiler_info(1); - my $var = $static ? 'static const' : 'extern'; my $count = $sized ? scalar(@{$a->{'Entries'}}) : ''; - print $fh "$var encpage_t $name\[$count];\n"; + if ($static) { + # we cannot ask Config for d_plusplus since we can override CC=g++-6 on the cmdline + print $fh "#ifdef __cplusplus\n"; # -fpermissive since g++-6 + print $fh "extern encpage_t $name\[$count];\n"; + print $fh "#else\n"; + print $fh "static const encpage_t $name\[$count];\n"; + print $fh "#endif\n"; + } else { + print $fh "extern encpage_t $name\[$count];\n"; + } } $a->{'DoneStrings'} = 1; foreach my $b (@{$a->{'Entries'}}) @@ -851,9 +872,16 @@ sub outtable outtable($fh,$t,$bigname) unless $t->{'Done'}; } my ($cpp, $static) = compiler_info(0); - my $var = $static ? 'static const ' : ''; - print $fh "\n${var}encpage_t $name\[", - scalar(@{$a->{'Entries'}}), "] = {\n"; + my $count = scalar(@{$a->{'Entries'}}); + if ($static) { + print $fh "#ifdef __cplusplus\n"; # -fpermissive since g++-6 + print $fh "encpage_t $name\[$count] = {\n"; + print $fh "#else\n"; + print $fh "static const encpage_t $name\[$count] = {\n"; + print $fh "#endif\n"; + } else { + print $fh "\nencpage_t $name\[$count] = {\n"; + } foreach my $b (@{$a->{'Entries'}}) { my ($sc,$ec,$out,$t,$end,$l,$fb) = @$b; @@ -1107,7 +1135,7 @@ sub _print_expand{ if ((my $d = dirname($dst)) ne '.'){ -d $d or mkdir $d, 0755 or die "mkdir $d : $!"; } - open my $out, ">$dst" or die "$!"; + open my $out, ">", $dst or die "$!"; my $asis = 0; while (<$in>){ if (/^#### END_OF_HEADER/){ diff --git a/bin/encguess b/bin/encguess index aae4c12c..6724b136 100755 --- a/bin/encguess +++ b/bin/encguess @@ -64,7 +64,7 @@ encguess - guess character encodings of files =head1 VERSION -$Id: encguess,v 0.1 2015/02/05 10:34:19 dankogai Exp $ +$Id: encguess,v 0.2 2016/08/04 03:15:58 dankogai Exp $ =head1 SYNOPSIS diff --git a/bin/h2ph b/bin/h2ph index 43f4dff5..527b00f9 100755 --- a/bin/h2ph +++ b/bin/h2ph @@ -85,8 +85,8 @@ while (defined (my $file = next_file())) { } } - open(IN,"$file") || (($Exit = 1),(warn "Can't open $file: $!\n"),next); - open(OUT,">$Dest_dir/$outfile") || die "Can't create $outfile: $!\n"; + open(IN, "<", "$file") || (($Exit = 1),(warn "Can't open $file: $!\n"),next); + open(OUT, ">", "$Dest_dir/$outfile") || die "Can't create $outfile: $!\n"; } print OUT @@ -703,7 +703,7 @@ sub queue_includes_from return if ($file eq "-"); - open HEADER, $file or return; + open HEADER, "<", $file or return; while (defined($line =
)) { while (/\\$/) { # Handle continuation lines chop $line; @@ -743,7 +743,7 @@ sub build_preamble_if_necessary # Can we skip building the preamble file? if (-r $preamble) { # Extract version number from first line of preamble: - open PREAMBLE, $preamble or die "Cannot open $preamble: $!"; + open PREAMBLE, "<", $preamble or die "Cannot open $preamble: $!"; my $line = ; $line =~ /(\b\d+\b)/; close PREAMBLE or die "Cannot close $preamble: $!"; @@ -754,7 +754,7 @@ sub build_preamble_if_necessary my (%define) = _extract_cc_defines(); - open PREAMBLE, ">$preamble" or die "Cannot open $preamble: $!"; + open PREAMBLE, ">", $preamble or die "Cannot open $preamble: $!"; print PREAMBLE "# This file was created by h2ph version $VERSION\n"; # Prevent non-portable hex constants from warning. # diff --git a/bin/h2xs b/bin/h2xs index 7fd34c49..27259f00 100755 --- a/bin/h2xs +++ b/bin/h2xs @@ -809,7 +809,7 @@ if( @path_h ){ # Scan the header file (we should deal with nested header files) # Record the names of simple #define constants into const_names # Function prototypes are processed below. - open(CH, "<$rel_path_h") || die "Can't open $rel_path_h: $!\n"; + open(CH, "<", "$rel_path_h") || die "Can't open $rel_path_h: $!\n"; defines: while () { if ($pre_sub_tri_graphs) { @@ -942,7 +942,7 @@ if( ! $opt_X ){ # use XS, unless it was disabled Devel::PPPort::WriteFile('ppport.h') || die "Can't create $ext$modpname/ppport.h: $!\n"; } - open(XS, ">$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n"; + open(XS, ">", "$modfname.xs") || die "Can't create $ext$modpname/$modfname.xs: $!\n"; if ($opt_x) { warn "Scanning typemaps...\n"; get_typemap(); @@ -1001,7 +1001,7 @@ if( ! $opt_X ){ # use XS, unless it was disabled } } { local $" = '|'; - $typedef_rex = qr(\b(?$modpmname") || die "Can't create $ext$modpname/$modpmname: $!\n"; +open(PM, ">", "$modpmname") || die "Can't create $ext$modpname/$modpmname: $!\n"; $" = "\n\t"; warn "Writing $ext$modpname/$modpmname\n"; @@ -1746,7 +1746,7 @@ sub get_typemap { warn " Scanning $typemap\n"; warn("Warning: ignoring non-text typemap file '$typemap'\n"), next unless -T $typemap ; - open(TYPEMAP, $typemap) + open(TYPEMAP, "<", $typemap) or warn ("Warning: could not open typemap file '$typemap': $!\n"), next; my $mode = 'Typemap'; while () { @@ -1839,7 +1839,7 @@ close XS; if (%types_seen) { my $type; warn "Writing $ext$modpname/typemap\n"; - open TM, ">typemap" or die "Cannot open typemap file for write: $!"; + open TM, ">", "typemap" or die "Cannot open typemap file for write: $!"; for $type (sort keys %types_seen) { my $entry = assign_typemap_entry $type; @@ -1873,7 +1873,7 @@ EOP } # if( ! $opt_X ) warn "Writing $ext$modpname/Makefile.PL\n"; -open(PL, ">Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n"; +open(PL, ">", "Makefile.PL") || die "Can't create $ext$modpname/Makefile.PL: $!\n"; my $prereq_pm = ''; @@ -1999,7 +1999,7 @@ close(PL) || die "Can't close $ext$modpname/Makefile.PL: $!\n"; # Create a simple README since this is a CPAN requirement # and it doesn't hurt to have one warn "Writing $ext$modpname/README\n"; -open(RM, ">README") || die "Can't create $ext$modpname/README:$!\n"; +open(RM, ">", "README") || die "Can't create $ext$modpname/README:$!\n"; my $thisyear = (gmtime)[5] + 1900; my $rmhead = "$modpname version $TEMPLATE_VERSION"; my $rmheadeq = "=" x length($rmhead); @@ -2066,7 +2066,7 @@ unless (-d "$testdir") { warn "Writing $ext$modpname/$testfile\n"; my $tests = @const_names ? 2 : 1; -open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n"; +open EX, ">", "$testfile" or die "Can't create $ext$modpname/$testfile: $!\n"; print EX <<_END_; # Before 'make install' is performed this script should be runnable with @@ -2172,7 +2172,7 @@ close(EX) || die "Can't close $ext$modpname/$testfile: $!\n"; unless ($opt_C) { warn "Writing $ext$modpname/Changes\n"; $" = ' '; - open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n"; + open(EX, ">", "Changes") || die "Can't create $ext$modpname/Changes: $!\n"; @ARGS = map {/[\s\"\'\`\$*?^|&<>\[\]\{\}\(\)]/ ? "'$_'" : $_} @ARGS; print EX <MANIFEST') or die "Can't create MANIFEST: $!"; +open(MANI, '>', 'MANIFEST') or die "Can't create MANIFEST: $!"; my @files = grep { -f } (<*>, , <$fallbackdirname/*>, <$modpmdir/*>); if (!@files) { eval {opendir(D,'.');}; diff --git a/bin/json_pp b/bin/json_pp index 7156735d..e2bb722e 100755 --- a/bin/json_pp +++ b/bin/json_pp @@ -36,7 +36,7 @@ if ( $version ) { $json_opt = '' if $json_opt eq '-'; -my @json_opt = grep { $allow_json_opt{ $_ } or die "'$_' is invalid json opttion" } split/,/, $json_opt; +my @json_opt = grep { $allow_json_opt{ $_ } or die "'$_' is not a valid json option" } split/,/, $json_opt; my %F = ( 'json' => sub { diff --git a/bin/libnetcfg b/bin/libnetcfg index 8d14d6e7..a190f38a 100755 --- a/bin/libnetcfg +++ b/bin/libnetcfg @@ -310,7 +310,7 @@ my %oldcfg = (); $Net::Config::CONFIGURE = 1; # Suppress load of user overrides if( -f $libnet_cfg_in ) { - %oldcfg = ( %{ do $libnet_cfg_in } ); + %oldcfg = ( %{ local @INC = '.'; do $libnet_cfg_in } ); } elsif (eval { require Net::Config }) { diff --git a/bin/perl b/bin/perl index 08ecf4a6..9e2e615f 100755 Binary files a/bin/perl and b/bin/perl differ diff --git a/bin/perl5.26.1 b/bin/perl5.26.1 new file mode 100755 index 00000000..9e2e615f Binary files /dev/null and b/bin/perl5.26.1 differ diff --git a/bin/perlbug b/bin/perlbug index 90f335dd..6487c911 100755 --- a/bin/perlbug +++ b/bin/perlbug @@ -2,9 +2,9 @@ eval 'exec /home/git/binary-com/perl/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; -my $config_tag1 = '5.24.1 - Fri Apr 7 04:17:54 UTC 2017'; +my $config_tag1 = '5.26.1 - Mon Oct 16 02:32:12 UTC 2017'; -my $patchlevel_date = 1483384486; +my $patchlevel_date = 1505057999; my @patches = Config::local_patches(); my $patch_tags = join "", map /(\S+)/ ? "+$1 " : (), @patches; @@ -28,6 +28,8 @@ BEGIN { $::HaveTemp = ($@ eq ""); eval { require Module::CoreList; }; $::HaveCoreList = ($@ eq ""); + eval { require Text::Wrap; }; + $::HaveWrap = ($@ eq ""); }; my $Version = "1.40"; @@ -45,6 +47,8 @@ my( $file, $usefile, $cc, $address, $bugaddress, $testaddress, $thanksaddress, %opt, $have_attachment, $attachments, $has_patch, $mime_boundary ); +my $running_noninteractively = !-t STDIN; + my $perl_version = $^V ? sprintf("%vd", $^V) : $]; my $config_tag2 = "$perl_version - $Config{cf_time}"; @@ -53,7 +57,7 @@ Init(); if ($opt{h}) { Help(); exit; } if ($opt{d}) { Dump(*STDOUT); exit; } -if (!-t STDIN && !($ok and not $opt{n})) { +if ($running_noninteractively && !$opt{t} && !($ok and not $opt{n})) { paraprint <<"EOF"; Please use $progname interactively. If you want to include a file, you can use the -f switch. @@ -703,7 +707,7 @@ sub Edit { $ed = $entry unless $entry eq ''; } - _edit_file($ed); + _edit_file($ed) unless $running_noninteractively; } sub _edit_file { @@ -780,16 +784,14 @@ a few options. You can: EOF retry: print $menu; - my $action = _prompt('', "Action (Send/Display/Edit/Subject/Save to File)");; + my $action = _prompt('', "Action (Send/Display/Edit/Subject/Save to File)", + $opt{t} ? 'q' : ''); print "\n"; if ($action =~ /^(f|sa)/i) { # ile/ve if ( SaveMessage() ) { exit } } elsif ($action =~ /^(d|l|sh)/i ) { # isplay, ist, ow # Display the message - open(REP, '<:raw', $filename) or die "Couldn't open file '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { print $_ } - close(REP) or die "Error closing report file '$filename': $!"; + print _read_report($filename); if ($have_attachment) { print "\n\n---\nAttachment(s):\n"; for my $att (split /\s*,\s*/, $attachments) { print " $att\n"; } @@ -831,7 +833,7 @@ sub TrivialSubject { if ($subject =~ /^(y(es)?|no?|help|perl( (bug|problem))?|bug|problem)$/i || length($subject) < 4 || - $subject !~ /\s/) { + ($subject !~ /\s/ && ! $opt{t})) { # non-whitespace is accepted in test mode print "\nThe subject you entered wasn't very descriptive. Please try again.\n\n"; return 1; } else { @@ -966,6 +968,7 @@ sub _prompt { } print $prompt. ($default ? " [$default]" :''). ": "; my $result = scalar(<>); + return $default if !defined $result; # got eof chomp($result); $result =~ s/^\s*(.*?)\s*$/$1/s; if ($default && $result eq '') { @@ -1032,13 +1035,29 @@ ATTACHMENT return $attach; } +sub _read_report { + my $fname = shift; + my $content; + open( REP, "<:raw", $fname ) or die "Couldn't open file '$fname': $!\n"; + binmode(REP, ':raw :crlf') if $Is_MSWin32; + # wrap long lines to make sure the report gets delivered + local $Text::Wrap::columns = 900; + local $Text::Wrap::huge = 'overflow'; + while () { + if ($::HaveWrap && /\S/) { # wrap() would remove empty lines + $content .= Text::Wrap::wrap(undef, undef, $_); + } else { + $content .= $_; + } + } + close(REP) or die "Error closing report file '$fname': $!"; + return $content; +} + sub build_complete_message { my $content = _build_header(%{_message_headers()}) . "\n\n"; $content .= _add_body_start() if $have_attachment; - open( REP, "<:raw", $filename ) or die "Couldn't open file '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { $content .= $_; } - close(REP) or die "Error closing report file '$filename': $!"; + $content .= _read_report($filename); $content .= _add_attachments() if $have_attachment; return $content; } @@ -1089,10 +1108,7 @@ sub _send_message_mailsend { $fh = $msg->open; binmode($fh, ':raw'); print $fh _add_body_start() if $have_attachment; - open(REP, "<:raw", $filename) or die "Couldn't open '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { print $fh $_ } - close(REP) or die "Error closing $filename: $!"; + print $fh _read_report($filename); print $fh _add_attachments() if $have_attachment; $fh->close or die "Error sending mail: $!"; @@ -1478,6 +1494,8 @@ 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 +testing purposes. =item B<-T> diff --git a/bin/perlivp b/bin/perlivp index 027f3ec1..b5ed019f 100755 --- a/bin/perlivp +++ b/bin/perlivp @@ -2,7 +2,7 @@ eval 'exec /home/git/binary-com/perl/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; -# perlivp v5.24.1 +# perlivp v5.26.1 BEGIN { pop @INC if $INC[-1] eq '.' } @@ -67,7 +67,7 @@ $tests_total++; print "## Checking Perl version via variable '\$]'.\n" if $opt{'p'}; -my $ivp_VERSION = "5.024001"; +my $ivp_VERSION = "5.026001"; $label = 'Perl version correct'; @@ -174,7 +174,7 @@ if (defined($Config{'extensions'})) { next if $_ eq 'XS/APItest'; next if $_ eq 'XS/Typemap'; # VMS$ perl -e "eval ""require \""Devel/DProf.pm\"";"" print $@" - # \NT> perl -e "eval \"require 'Devel/DProf.pm'\"; print $@" + # \NT> perl -e "eval \"require './Devel/DProf.pm'\"; print $@" # DProf: run perl with -d to use DProf. # Compilation failed in require at (eval 1) line 1. eval " require \"$_.pm\"; "; diff --git a/bin/perlthanks b/bin/perlthanks index 90f335dd..6487c911 100755 --- a/bin/perlthanks +++ b/bin/perlthanks @@ -2,9 +2,9 @@ eval 'exec /home/git/binary-com/perl/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; -my $config_tag1 = '5.24.1 - Fri Apr 7 04:17:54 UTC 2017'; +my $config_tag1 = '5.26.1 - Mon Oct 16 02:32:12 UTC 2017'; -my $patchlevel_date = 1483384486; +my $patchlevel_date = 1505057999; my @patches = Config::local_patches(); my $patch_tags = join "", map /(\S+)/ ? "+$1 " : (), @patches; @@ -28,6 +28,8 @@ BEGIN { $::HaveTemp = ($@ eq ""); eval { require Module::CoreList; }; $::HaveCoreList = ($@ eq ""); + eval { require Text::Wrap; }; + $::HaveWrap = ($@ eq ""); }; my $Version = "1.40"; @@ -45,6 +47,8 @@ my( $file, $usefile, $cc, $address, $bugaddress, $testaddress, $thanksaddress, %opt, $have_attachment, $attachments, $has_patch, $mime_boundary ); +my $running_noninteractively = !-t STDIN; + my $perl_version = $^V ? sprintf("%vd", $^V) : $]; my $config_tag2 = "$perl_version - $Config{cf_time}"; @@ -53,7 +57,7 @@ Init(); if ($opt{h}) { Help(); exit; } if ($opt{d}) { Dump(*STDOUT); exit; } -if (!-t STDIN && !($ok and not $opt{n})) { +if ($running_noninteractively && !$opt{t} && !($ok and not $opt{n})) { paraprint <<"EOF"; Please use $progname interactively. If you want to include a file, you can use the -f switch. @@ -703,7 +707,7 @@ sub Edit { $ed = $entry unless $entry eq ''; } - _edit_file($ed); + _edit_file($ed) unless $running_noninteractively; } sub _edit_file { @@ -780,16 +784,14 @@ a few options. You can: EOF retry: print $menu; - my $action = _prompt('', "Action (Send/Display/Edit/Subject/Save to File)");; + my $action = _prompt('', "Action (Send/Display/Edit/Subject/Save to File)", + $opt{t} ? 'q' : ''); print "\n"; if ($action =~ /^(f|sa)/i) { # ile/ve if ( SaveMessage() ) { exit } } elsif ($action =~ /^(d|l|sh)/i ) { # isplay, ist, ow # Display the message - open(REP, '<:raw', $filename) or die "Couldn't open file '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { print $_ } - close(REP) or die "Error closing report file '$filename': $!"; + print _read_report($filename); if ($have_attachment) { print "\n\n---\nAttachment(s):\n"; for my $att (split /\s*,\s*/, $attachments) { print " $att\n"; } @@ -831,7 +833,7 @@ sub TrivialSubject { if ($subject =~ /^(y(es)?|no?|help|perl( (bug|problem))?|bug|problem)$/i || length($subject) < 4 || - $subject !~ /\s/) { + ($subject !~ /\s/ && ! $opt{t})) { # non-whitespace is accepted in test mode print "\nThe subject you entered wasn't very descriptive. Please try again.\n\n"; return 1; } else { @@ -966,6 +968,7 @@ sub _prompt { } print $prompt. ($default ? " [$default]" :''). ": "; my $result = scalar(<>); + return $default if !defined $result; # got eof chomp($result); $result =~ s/^\s*(.*?)\s*$/$1/s; if ($default && $result eq '') { @@ -1032,13 +1035,29 @@ ATTACHMENT return $attach; } +sub _read_report { + my $fname = shift; + my $content; + open( REP, "<:raw", $fname ) or die "Couldn't open file '$fname': $!\n"; + binmode(REP, ':raw :crlf') if $Is_MSWin32; + # wrap long lines to make sure the report gets delivered + local $Text::Wrap::columns = 900; + local $Text::Wrap::huge = 'overflow'; + while () { + if ($::HaveWrap && /\S/) { # wrap() would remove empty lines + $content .= Text::Wrap::wrap(undef, undef, $_); + } else { + $content .= $_; + } + } + close(REP) or die "Error closing report file '$fname': $!"; + return $content; +} + sub build_complete_message { my $content = _build_header(%{_message_headers()}) . "\n\n"; $content .= _add_body_start() if $have_attachment; - open( REP, "<:raw", $filename ) or die "Couldn't open file '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { $content .= $_; } - close(REP) or die "Error closing report file '$filename': $!"; + $content .= _read_report($filename); $content .= _add_attachments() if $have_attachment; return $content; } @@ -1089,10 +1108,7 @@ sub _send_message_mailsend { $fh = $msg->open; binmode($fh, ':raw'); print $fh _add_body_start() if $have_attachment; - open(REP, "<:raw", $filename) or die "Couldn't open '$filename': $!\n"; - binmode(REP, ':raw :crlf') if $Is_MSWin32; - while () { print $fh $_ } - close(REP) or die "Error closing $filename: $!"; + print $fh _read_report($filename); print $fh _add_attachments() if $have_attachment; $fh->close or die "Error sending mail: $!"; @@ -1478,6 +1494,8 @@ 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 +testing purposes. =item B<-T> diff --git a/bin/piconv b/bin/piconv index dc993d27..19812e13 100755 --- a/bin/piconv +++ b/bin/piconv @@ -2,7 +2,7 @@ eval 'exec /home/git/binary-com/perl/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; #!./perl -# $Id: piconv,v 2.7 2014/05/31 09:48:48 dankogai Exp $ +# $Id: piconv,v 2.8 2016/08/04 03:15:58 dankogai Exp $ # BEGIN { pop @INC if $INC[-1] eq '.' } use 5.8.0; diff --git a/bin/pl2pm b/bin/pl2pm index f1c6578d..49f57ac4 100755 --- a/bin/pl2pm +++ b/bin/pl2pm @@ -93,7 +93,7 @@ while (<>) { $export_ok = "\@EXPORT_OK = qw(@export_ok);\n"; } - if ( open(PM, ">$newname") ) { + if ( open(PM, ">", $newname) ) { print PM <<"END"; package $newpack; use 5.006; diff --git a/bin/pod2man b/bin/pod2man index 0345df95..4b8e3308 100755 --- a/bin/pod2man +++ b/bin/pod2man @@ -34,8 +34,9 @@ my %options; Getopt::Long::config ('bundling_override'); GetOptions (\%options, 'center|c=s', 'date|d=s', 'errors=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s', 'fixedbolditalic=s', 'help|h', - 'lax|l', 'name|n=s', 'nourls', 'official|o', 'quotes|q=s', - 'release|r=s', 'section|s=s', 'stderr', 'verbose|v', 'utf8|u') + 'lax|l', 'lquote=s', 'name|n=s', 'nourls', 'official|o', + 'quotes|q=s', 'release|r=s', 'rquote=s', 'section|s=s', 'stderr', + 'verbose|v', 'utf8|u') or exit 1; pod2usage (0) if $options{help}; @@ -83,7 +84,7 @@ __END__ =for stopwords en em --stderr stderr --utf8 UTF-8 overdo markup MT-LEVEL Allbery Solaris URL troff troff-specific formatters uppercased Christiansen --nourls UTC -prepend +prepend lquote rquote =head1 NAME @@ -94,9 +95,9 @@ pod2man - Convert POD data to formatted *roff input pod2man [B<--center>=I] [B<--date>=I] [B<--errors>=I