1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 70_upstream_pdldoc_apropos.dpatch by Henning Glawe <glaweh@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Backport from upstream cvs: make apropos function in pdldoc work with perl 5.10
8
diff -urNad pdl-2.4.3~/Doc/Doc/Perldl.pm pdl-2.4.3/Doc/Doc/Perldl.pm
9
--- pdl-2.4.3~/Doc/Doc/Perldl.pm 2004-03-18 07:49:04.000000000 +0100
10
+++ pdl-2.4.3/Doc/Doc/Perldl.pm 2008-09-22 00:17:40.235509207 +0200
18
$PDL::onlinedoc = undef;
19
$PDL::onlinedoc = new PDL::Doc (FindStdFile());
22
my $bvalflag = $PDL::Config{WITH_BADVAL} || 0;
24
-# pod commands are stripped from the ref string before printing.
25
-# How we do this depends on the version of Pod::Text installed.
27
-# I'm guessing the difference in behaviour is between versions
28
-# 1 and 2 of Pod::Text (it's certainly true for
29
-# version 1.0203 (perl5.005_03) and 2.03 (perl 5.6.0))
32
-# we use a private routine from Pod::Text
33
-# (prepare_for_output) in printmatch() in order
34
-# to strip away pod directives from the ref
37
-# version 2: (Thanks to Tim Jenness)
38
-# create an object and use the interpol() method
48
-# the $^W assignment stops Pod::Text::fill() from
49
-# generating "Use of uninitialised values" errors
55
# for the given matches
64
- my $width = screen_width()-17;
65
- if ( $Pod::Text::VERSION < 2 ) {
66
- $Pod::Text::indent = 0;
67
- $Pod::Text::SCREEN = $width;
69
- for my $m (@match) {
70
- $_ = $m->[1]{Ref} ||
71
- ( (defined $m->[1]{CustomFile})
72
- ? "[No ref avail. for `".$m->[1]{CustomFile}."']"
73
- : "[No reference available]"
75
- Pod::Text::prepare_for_output(); # adds a '\n' to $_
76
- $_ = Pod::Text::fill $_; # try and get `nice' wrapping
77
- s/\n*$//; # remove last new lines (so substitution doesn't append spaces at end of text)
80
- if ( length($name) > 15 ) {
81
- push @text, sprintf "%s ...\n %s\n", $name, $_;
83
- push @text, sprintf "%-15s %s\n", $name, $_;
87
- my $parser = new Pod::Text( width => $width, indent => 0, sentence => 0 );
89
- for my $m (@match) {
90
- my $ref = $m->[1]{Ref} ||
91
- ( (defined $m->[1]{CustomFile})
92
- ? "[No ref avail. for `".$m->[1]{CustomFile}."']"
93
- : "[No reference available]"
95
+ my $width = screen_width()-17;
96
+ my $parser = new Pod::PlainText( width => $width, indent => 0, sentence => 0 );
98
- $ref = $parser->interpolate( $ref );
99
- $ref = $parser->reformat( $ref );
101
- # remove last new lines (so substitution doesn't append spaces at end of text)
103
- $ref =~ s/\n/\n /g;
104
+ for my $m (@match) {
105
+ my $ref = $m->[1]{Ref} ||
106
+ ( (defined $m->[1]{CustomFile})
107
+ ? "[No ref avail. for `".$m->[1]{CustomFile}."']"
108
+ : "[No reference available]"
111
- my $name = $m->[0];
112
- if ( length($name) > 15 ) {
113
- push @text, sprintf "%s ...\n %s\n", $name, $ref;
115
- push @text, sprintf "%-15s %s\n", $name, $ref;
118
+ $ref = $parser->interpolate( $ref );
119
+ $ref = $parser->reformat( $ref );
121
+ # remove last new lines (so substitution doesn't append spaces at end of text)
123
+ $ref =~ s/\n/\n /g;
125
+ my $name = $m->[0];
126
+ if ( length($name) > 15 ) {
127
+ push @text, sprintf "%s ...\n %s\n", $name, $ref;
129
+ push @text, sprintf "%-15s %s\n", $name, $ref;
131
- return wantarray ? @text : $text[0];
133
+ return wantarray ? @text : $text[0];
135
} # sub: format_ref()