diff options
author | Zefram <zefram@fysh.org> | 2017-10-07 05:17:19 +0100 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-10-16 16:29:17 +0100 |
commit | f2ee4cb897ec9dd3338abcd0e9a42cb41ce9a173 (patch) | |
tree | ac17aad85789dca246fb803366f164ab04c73e60 | |
parent | f6d7499a254e64c1114bf95c89e5c65a22597416 (diff) | |
download | perl-f2ee4cb897ec9dd3338abcd0e9a42cb41ce9a173.tar.gz |
customise Pod::Perldoc to fix output misbehaviour
Pod::Perldoc has, since version 3.20, exhibited various kinds of
misbehaviour relating to a bad default choice of formatter. Output has
sometimes appeared mangled due to the newly-default formatter emitting
unportable escape sequences, and sometimes there has been a more
severe output failure due to perldoc making unportable changes to pager
configuration in an attempt to make the escape sequences work. This is
discussed in [perl #131762]. In the upstream instance of the module
there have been tweaks to the unportable behaviour, but not an actual fix.
In order to make the core distro ship a reliably-working version of
perldoc, this patch customises Pod::Perldoc to implement the obvious
fix for the portability problems. The fixed version defaults to the
ToText formatter, which produces properly plain text that will go through
any pager. It never attempts any change to pager configuration.
-rwxr-xr-x | Porting/Maintainers.pl | 5 | ||||
-rw-r--r-- | cpan/Pod-Perldoc/lib/Pod/Perldoc.pm | 12 | ||||
-rw-r--r-- | t/porting/customized.dat | 1 |
3 files changed, 7 insertions, 11 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 539fb5aadd..8f5ef86bc0 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -933,6 +933,11 @@ use File::Glob qw(:case); # https://rt.cpan.org/Ticket/Display.html?id=116827 't/02_module_pod_output.t' ], + + 'CUSTOMIZED' => [ + # [rt.cpan.org #88204], [rt.cpan.org #120229] + 'lib/Pod/Perldoc.pm', + ], }, 'Pod::Simple' => { diff --git a/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm b/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm index 8d695b2b4b..bb6ffc83ef 100644 --- a/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm +++ b/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm @@ -12,7 +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.28'; +$VERSION = '3.2801'; #.......................................................................... @@ -486,11 +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; } @@ -1937,11 +1932,6 @@ sub page { # apply a pager to the output file } elsif($self->is_amigaos) { last if system($pager, $output) == 0; } else { - my $formatter = $self->{'formatter_class'}; - if ( $formatter->can('pager_configuration') ) { - $self->aside("About to call $formatter" . "->pager_configuration(\"$pager\")\n"); - $formatter->pager_configuration($pager, $self); - } last if system("$pager \"$output\"") == 0; } } diff --git a/t/porting/customized.dat b/t/porting/customized.dat index 986417de09..a7d20fe662 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -14,6 +14,7 @@ Pod::Checker cpan/Pod-Checker/t/pod/contains_bad_pod.xr 73538fd80dfe6e19ad561fe0 Pod::Checker cpan/Pod-Checker/t/pod/selfcheck.t 8ce3cfd38e4b9bcf5bc7fe7f2a14195e49aed7d8 Pod::Checker cpan/Pod-Checker/t/pod/testcmp.pl a0cd5c8eca775c7753f4464eee96fa916e3d8a16 Pod::Checker cpan/Pod-Checker/t/pod/testpchk.pl b2072c7f4379fd050e15424175d7cac5facf5b3b +Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm 582be34c077c9ff44d99914724a0cc2140bcd48c Socket cpan/Socket/Socket.pm 98e38176d745c38282907f391c077298f5a3d0ba Socket cpan/Socket/Socket.xs edd4fed212785f11c5c2095a75941dad27d586d9 autodie cpan/autodie/t/mkdir.t 9e70d2282a3cc7d76a78bf8144fccba20fb37dac |