diff options
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Pod-Perldoc/lib')
13 files changed, 70 insertions, 37 deletions
diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm index 787353ba588..bb6ffc83efb 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm @@ -12,8 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir); use vars qw($VERSION @Pagers $Bindir $Pod2man $Temp_Files_Created $Temp_File_Lifetime ); -$VERSION = '3.25_03'; # patched in perl5.git -$VERSION =~ s/_//; +$VERSION = '3.2801'; #.......................................................................... @@ -285,7 +284,8 @@ Options: -m Display module's file in its entirety -n Specify replacement for groff -l Display the module's file name - -F Arguments are file names, not modules + -U Don't attempt to drop privs for security + -F Arguments are file names, not modules (implies -U) -D Verbosely describe what's going on -T Send output to STDOUT without any pager -d output_filename_to_send_to @@ -393,7 +393,7 @@ sub usage_brief { my $program_name = $self->program_name; CORE::die( <<"EOUSAGE" ); -Usage: $program_name [-hVriDtumFXlT] [-n nroffer_program] +Usage: $program_name [-hVriDtumUFXlT] [-n nroffer_program] [-d output_filename] [-o output_format] [-M FormatterModule] [-w formatter_option:option_value] [-L translation_code] PageName|ModuleName|ProgramName @@ -486,10 +486,6 @@ sub init_formatter_class_list { $self->opt_M_with('Pod::Perldoc::ToPod'); # the always-there fallthru $self->opt_o_with('text'); - $self->opt_o_with('term') unless $self->is_mswin32 || $self->is_dos || $self->is_amigaos - || !($ENV{TERM} && ( - ($ENV{TERM} || '') !~ /dumb|emacs|none|unknown/i - )); return; } @@ -521,7 +517,7 @@ sub process { $self->options_reading; $self->pagers_guessing; $self->aside(sprintf "$0 => %s v%s\n", ref($self), $self->VERSION); - $self->drop_privs_maybe unless $self->opt_U; + $self->drop_privs_maybe unless ($self->opt_U || $self->opt_F); $self->options_processing; # Hm, we have @pages and @found, but we only really act on one @@ -850,8 +846,11 @@ sub grand_search_init { =~ s/\.P(?:[ML]|OD)\z//; } else { - print STDERR "No " . + print STDERR "No " . ($self->opt_m ? "module" : "documentation") . " found for \"$_\".\n"; + if ( /^https/ ) { + print STDERR "You may need an SSL library (such as IO::Socket::SSL) for that URL.\n"; + } } next; } @@ -1326,7 +1325,7 @@ sub search_perlfunc { local $_; while (<$fh>) { /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1); - last if /^=head2 $re/; + last if /^=head2 (?:$re|Alphabetical Listing of Perl Functions)/; } # Look for our function @@ -1360,7 +1359,7 @@ sub search_perlfunc { last if $found > 1 and $inlist < 2; } } - elsif (/^=item/) { + elsif (/^=item|^=back/) { last if $found > 1 and $inlist < 2; } elsif ($found and /^X<[^>]+>/) { @@ -1669,9 +1668,9 @@ sub pagers_guessing { push @pagers, qw( less.exe more.com< ); unshift @pagers, $ENV{PAGER} if $ENV{PAGER}; } - elsif ( $self->is_amigaos) { - push @pagers, qw( /SYS/Utilities/MultiView /SYS/Utilities/More /C/TYPE ); - unshift @pagers, "$ENV{PAGER}" if $ENV{PAGER}; + elsif ( $self->is_amigaos) { + push @pagers, qw( /SYS/Utilities/MultiView /SYS/Utilities/More /C/TYPE ); + unshift @pagers, "$ENV{PAGER}" if $ENV{PAGER}; } else { if ($self->is_os2) { @@ -1696,7 +1695,7 @@ sub pagers_guessing { unshift @pagers, "$ENV{PERLDOC_PAGER} <" if $ENV{PERLDOC_PAGER}; } - $self->aside("Pagers: ", @pagers); + $self->aside("Pagers: ", (join ", ", @pagers)); return; } @@ -1923,19 +1922,16 @@ sub page { # apply a pager to the output file # many many corners of the OS don't like it. So we # have to force it to be "\" to make everyone happy. - # if we are on an amiga convert unix path to an amiga one - $output =~ s/^\/(.*)\/(.*)/$1:$2/ if $self->is_amigaos; + # if we are on an amiga convert unix path to an amiga one + $output =~ s/^\/(.*)\/(.*)/$1:$2/ if $self->is_amigaos; foreach my $pager (@pagers) { $self->aside("About to try calling $pager $output\n"); if ($self->is_vms) { last if system("$pager $output") == 0; - } elsif($self->is_amigaos) { + } elsif($self->is_amigaos) { last if system($pager, $output) == 0; } else { - # fix visible escape codes in ToTerm output - # https://bugs.debian.org/758689 - local $ENV{LESS} = defined $ENV{LESS} ? "$ENV{LESS} -R" : "-R"; last if system("$pager \"$output\"") == 0; } } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm index 304da44ede2..37f651047d6 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm @@ -3,7 +3,7 @@ use strict; use warnings; use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; use Carp qw(croak carp); use Config qw(%Config); @@ -33,6 +33,7 @@ BEGIN { *is_linux = $^O eq 'linux' ? \&TRUE : \&FALSE unless defined &is_linux; *is_hpux = $^O =~ m/hpux/ ? \&TRUE : \&FALSE unless defined &is_hpux; *is_openbsd = $^O =~ m/openbsd/ ? \&TRUE : \&FALSE unless defined &is_openbsd; + *is_freebsd = $^O =~ m/freebsd/ ? \&TRUE : \&FALSE unless defined &is_freebsd; *is_bitrig = $^O =~ m/bitrig/ ? \&TRUE : \&FALSE unless defined &is_bitrig; } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/GetOptsOO.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/GetOptsOO.pm index 71fcc7bc9a2..afa2574ec7e 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/GetOptsOO.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/GetOptsOO.pm @@ -2,7 +2,7 @@ package Pod::Perldoc::GetOptsOO; use strict; use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; BEGIN { # Make a DEBUG constant ASAP *DEBUG = defined( &Pod::Perldoc::DEBUG ) diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToANSI.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToANSI.pm index 26a11d3c809..8217c7b1bc4 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToANSI.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToANSI.pm @@ -4,7 +4,7 @@ use warnings; use parent qw(Pod::Perldoc::BaseTo); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; sub is_pageable { 1 } sub write_with_binmode { 0 } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToChecker.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToChecker.pm index 3d161acf51c..a6dbbe3f033 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToChecker.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToChecker.pm @@ -4,7 +4,7 @@ use warnings; use vars qw(@ISA); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; # Pick our superclass... # diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm index e22e05044d1..bfcb5c40ee6 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm @@ -5,7 +5,7 @@ use warnings; use parent qw(Pod::Perldoc::BaseTo); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; use File::Spec::Functions qw(catfile); use Pod::Man 2.18; @@ -63,7 +63,7 @@ sub init { sub _roffer_candidates { my( $self ) = @_; - if( $self->is_openbsd || $self->is_bitrig ) { qw( mandoc groff nroff ) } + if( $self->is_openbsd || $self->is_freebsd || $self->is_bitrig ) { qw( mandoc groff nroff ) } else { qw( groff nroff mandoc ) } } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToNroff.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToNroff.pm index ac4a8aa17d4..a52f6160192 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToNroff.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToNroff.pm @@ -4,7 +4,7 @@ use warnings; use parent qw(Pod::Perldoc::BaseTo); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; # This is unlike ToMan.pm in that it emits the raw nroff source! diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToPod.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToPod.pm index 8433e8ca409..825a1caaf5b 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToPod.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToPod.pm @@ -4,7 +4,7 @@ use warnings; use parent qw(Pod::Perldoc::BaseTo); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; sub is_pageable { 1 } sub write_with_binmode { 0 } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm index 81f019f8a20..d084816cab2 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm @@ -4,7 +4,7 @@ use warnings; use parent qw( Pod::Simple::RTF ); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; sub is_pageable { 0 } sub write_with_binmode { 0 } diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTerm.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTerm.pm index e97a775e10e..9501d6310e7 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTerm.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTerm.pm @@ -3,7 +3,7 @@ use strict; use warnings; use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; use parent qw(Pod::Perldoc::BaseTo); @@ -26,6 +26,34 @@ sub width { $self->_get_default_width; } +sub pager_configuration { + my($self, $pager, $perldoc) = @_; + + # do not modify anything on Windows or DOS + return if ( $perldoc->is_mswin32 || $perldoc->is_dos ); + + if ( $pager =~ /less/ ) { + $self->_maybe_modify_environment('LESS'); + } + elsif ( $pager =~ /more/ ) { + $self->_maybe_modify_environment('MORE'); + } + + return; +} + +sub _maybe_modify_environment { + my($self, $name) = @_; + + if ( ! defined $ENV{$name} ) { + $ENV{$name} = "-R"; + } + + # if the environment is set, don't modify + # anything + +} + sub _get_stty { `stty -a` } sub _get_columns_from_stty { @@ -89,7 +117,7 @@ sub parse_from_file { =head1 NAME -Pod::Perldoc::ToTerm - render Pod with terminal escapes +Pod::Perldoc::ToTerm - render Pod with terminal escapes =head1 SYNOPSIS @@ -107,6 +135,14 @@ For example: perldoc -o term -w indent:5 Some::Modulename +=head1 PAGER FORMATTING + +Depending on the platform, and because this class emits terminal escapes it +will attempt to set the C<-R> flag on your pager by injecting the flag into +your environment variable for C<less> or C<more>. + +On Windows and DOS, this class will not modify any environment variables. + =head1 CAVEAT This module may change to use a different text formatter class in the @@ -118,7 +154,7 @@ L<Pod::Text>, L<Pod::Text::Termcap>, L<Pod::Perldoc> =head1 COPYRIGHT AND DISCLAIMERS -Copyright (c) 2011 Mark Allen. +Copyright (c) 2017 Mark Allen. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToText.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToText.pm index dbd47438d3a..99ab66c3048 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToText.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToText.pm @@ -3,7 +3,7 @@ use strict; use warnings; use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; use parent qw(Pod::Perldoc::BaseTo); diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTk.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTk.pm index 40b51c5b438..6ca7542c7af 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTk.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTk.pm @@ -3,7 +3,7 @@ use strict; use warnings; use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; use parent qw(Pod::Perldoc::BaseTo); diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToXml.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToXml.pm index 9da514f7f61..0161c048a9c 100644 --- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToXml.pm +++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToXml.pm @@ -6,7 +6,7 @@ use vars qw($VERSION); use parent qw( Pod::Simple::XMLOutStream ); use vars qw($VERSION); -$VERSION = '3.25'; +$VERSION = '3.28'; sub is_pageable { 0 } sub write_with_binmode { 0 } |