/[pkgs]/devel/perl/perl-5.10.0-links.patch
ViewVC logotype

Contents of /devel/perl/perl-5.10.0-links.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Wed Mar 11 21:12:37 2009 UTC (8 months, 1 week ago) by kasal
Branch: MAIN
CVS Tags: F-12-split, perl-5_10_0-63_fc11, perl-5_10_0-61_fc11, perl-5_10_0-80_fc12, perl-5_10_0-81_fc12, perl-5_10_0-84_fc13, perl-5_10_0-82_fc13, perl-5_10_0-77_fc12, perl-5_10_0-83_fc13, perl-5_10_0-71_fc12, perl-5_10_0-75_fc12, perl-5_10_0-73_fc12, perl-5_10_0-68_fc11, perl-5_10_0-67_fc11, perl-5_10_0-64_fc11, perl-5_10_0-72_fc12, F-11-split, perl-5_10_0-62_fc11, perl-5_10_0-69_fc12, perl-5_10_0-79_fc12, perl-5_10_0-78_fc12, perl-5_10_0-70_fc12, perl-5_10_0-74_fc12, perl-5_10_0-66_fc11, perl-5_10_0-65_fc11, perl-5_10_0-60_fc11, perl-5_10_0-76_fc12, HEAD
Changes since 1.1: +47 -35 lines
File MIME type: text/x-patch
- remove compatibility obsolete sitelib directories
- use a better BuildRoot
- drop a redundant mkdir in %%install
- call patchlevel.h only once; rm patchlevel.bak
- update modules Sys::Syslog, Module::Load::Conditional, Module::CoreList,
  Test::Harness, Test::Simple, CGI.pm (dropping the upstreamed patch),
  File::Path (that includes our perl-5.10.0-CVE-2008-2827.patch),
  constant, Pod::Simple, Archive::Tar, Archive::Extract, File::Fetch,
  File::Temp, IPC::Cmd, Time::HiRes, Module::Build, ExtUtils::CBuilder
- standardize the patches for updating embedded modules
- work around a bug in Module::Build tests bu setting TMPDIR to a directory
  inside the source tree
1 diff -up perl-5.10.0/lib/File/Fetch.pm.BAD perl-5.10.0/lib/File/Fetch.pm
2 --- perl-5.10.0.orig/lib/File/Fetch.pm 2009-03-11 14:21:00.000000000 +0100
3 +++ perl-5.10.0/lib/File/Fetch.pm 2009-03-11 14:23:26.000000000 +0100
4 @@ -35,7 +35,7 @@ $WARN = 1;
5
6 ### methods available to fetch the file depending on the scheme
7 $METHODS = {
8 - http => [ qw|lwp wget curl lftp lynx| ],
9 + http => [ qw|lwp wget curl lftp links| ],
10 ftp => [ qw|lwp netftp wget curl lftp ncftp ftp| ],
11 file => [ qw|lwp lftp file| ],
12 rsync => [ qw|rsync| ]
13 @@ -772,9 +772,9 @@ sub _ftp_fetch {
14 }
15 }
16
17 -### lynx is stupid - it decompresses any .gz file it finds to be text
18 -### use /bin/lynx to fetch files
19 -sub _lynx_fetch {
20 +### links is stupid - it decompresses any .gz file it finds to be text
21 +### use /bin/links to fetch files
22 +sub _links_fetch {
23 my $self = shift;
24 my %hash = @_;
25
26 @@ -784,21 +784,21 @@ sub _lynx_fetch {
27 };
28 check( $tmpl, \%hash ) or return;
29
30 - ### see if we have a lynx binary ###
31 - if( my $lynx = can_run('lynx') ) {
32 + ### see if we have a links binary ###
33 + if( my $links = can_run('links') ) {
34
35 unless( IPC::Cmd->can_capture_buffer ) {
36 - $METHOD_FAIL->{'lynx'} = 1;
37 + $METHOD_FAIL->{'links'} = 1;
38
39 return $self->_error(loc(
40 "Can not capture buffers. Can not use '%1' to fetch files",
41 - 'lynx' ));
42 + 'links' ));
43 }
44
45 ### check if the HTTP resource exists ###
46 if ($self->uri =~ /^https?:\/\//i) {
47 my $cmd = [
48 - $lynx,
49 + $links,
50 '-head',
51 '-source',
52 "-auth=anonymous:$FROM_EMAIL",
53 @@ -822,14 +822,14 @@ sub _lynx_fetch {
54 }
55 }
56
57 - ### write to the output file ourselves, since lynx ass_u_mes to much
58 + ### write to the output file ourselves, since links ass_u_mes to much
59 my $local = FileHandle->new(">$to")
60 or return $self->_error(loc(
61 "Could not open '%1' for writing: %2",$to,$!));
62
63 ### dump to stdout ###
64 my $cmd = [
65 - $lynx,
66 + $links,
67 '-source',
68 "-auth=anonymous:$FROM_EMAIL",
69 ];
70 @@ -860,7 +860,7 @@ sub _lynx_fetch {
71 ### XXX on a 404 with a special error page, $captured will actually
72 ### hold the contents of that page, and make it *appear* like the
73 ### request was a success, when really it wasn't :(
74 - ### there doesn't seem to be an option for lynx to change the exit
75 + ### there doesn't seem to be an option for links to change the exit
76 ### code based on a 4XX status or so.
77 ### the closest we can come is using --error_file and parsing that,
78 ### which is very unreliable ;(
79 @@ -870,7 +870,7 @@ sub _lynx_fetch {
80 return $to;
81
82 } else {
83 - $METHOD_FAIL->{'lynx'} = 1;
84 + $METHOD_FAIL->{'links'} = 1;
85 return;
86 }
87 }
88 @@ -1150,7 +1150,7 @@ Below is a mapping of what utilities wil
89 for what schemes, if available:
90
91 file => LWP, lftp, file
92 - http => LWP, wget, curl, lftp, lynx
93 + http => LWP, wget, curl, lftp, links
94 ftp => LWP, Net::FTP, wget, curl, lftp, ncftp, ftp
95 rsync => rsync
96
97 @@ -1262,7 +1262,7 @@ the $BLACKLIST, $METHOD_FAIL and other i
98 LWP => lwp
99 Net::FTP => netftp
100 wget => wget
101 - lynx => lynx
102 + links => links
103 ncftp => ncftp
104 ftp => ftp
105 curl => curl
106 @@ -1281,17 +1281,17 @@ example, to use an ftp proxy:
107
108 Refer to the LWP::UserAgent manpage for more details.
109
110 -=head2 I used 'lynx' to fetch a file, but its contents is all wrong!
111 +=head2 I used 'links' to fetch a file, but its contents is all wrong!
112
113 -C<lynx> can only fetch remote files by dumping its contents to C<STDOUT>,
114 +C<links> can only fetch remote files by dumping its contents to C<STDOUT>,
115 which we in turn capture. If that content is a 'custom' error file
116 (like, say, a C<404 handler>), you will get that contents instead.
117
118 -Sadly, C<lynx> doesn't support any options to return a different exit
119 +Sadly, C<links> doesn't support any options to return a different exit
120 code on non-C<200 OK> status, giving us no way to tell the difference
121 between a 'successfull' fetch and a custom error page.
122
123 -Therefor, we recommend to only use C<lynx> as a last resort. This is
124 +Therefor, we recommend to only use C<links> as a last resort. This is
125 why it is at the back of our list of methods to try as well.
126
127 =head2 Files I'm trying to fetch have reserved characters or non-ASCII characters in them. What do I do?
128 diff -up perl-5.10.0/lib/File/Fetch/t/01_File-Fetch.t.BAD perl-5.10.0/lib/File/Fetch/t/01_File-Fetch.t
129 --- perl-5.10.0.orig/lib/File/Fetch/t/01_File-Fetch.t 2009-03-11 14:21:00.000000000 +0100
130 +++ perl-5.10.0/lib/File/Fetch/t/01_File-Fetch.t 2009-03-11 14:22:10.000000000 +0100
131 @@ -177,7 +177,7 @@ for my $entry (@map) {
132 'http://www.cpan.org/index.html?q=1',
133 'http://www.cpan.org/index.html?q=1&y=2',
134 ) {
135 - for (qw[lwp wget curl lftp lynx]) {
136 + for (qw[lwp wget curl lftp links]) {
137 _fetch_uri( http => $uri, $_ );
138 }
139 }
140 diff -up perl-5.10.0/lib/CPAN.pm.BAD perl-5.10.0/lib/CPAN.pm
141 --- perl-5.10.0.orig/lib/CPAN.pm 2007-12-18 11:47:07.000000000 +0100
142 +++ perl-5.10.0/lib/CPAN.pm 2009-03-11 14:21:21.000000000 +0100
143 @@ -4318,7 +4318,7 @@ sub hostdlhard {
144
145 # Try the most capable first and leave ncftp* for last as it only
146 # does FTP.
147 - DLPRG: for my $f (qw(curl wget lynx ncftpget ncftp)) {
148 + DLPRG: for my $f (qw(curl wget links ncftpget ncftp)) {
149 my $funkyftp = CPAN::HandleConfig->safe_quote($CPAN::Config->{$f});
150 next unless defined $funkyftp;
151 next if $funkyftp =~ /^\s*$/;
152 @@ -4330,7 +4330,7 @@ sub hostdlhard {
153 my($src_switch) = "";
154 my($chdir) = "";
155 my($stdout_redir) = " > $asl_ungz";
156 - if ($f eq "lynx") {
157 + if ($f eq "links") {
158 $src_switch = " -source";
159 } elsif ($f eq "ncftp") {
160 $src_switch = " -c";
161 @@ -4354,8 +4354,8 @@ Trying with "$funkyftp$src_switch" to ge
162 "$chdir$funkyftp$src_switch \"$url\" $devnull$stdout_redir";
163 $self->debug("system[$system]") if $CPAN::DEBUG;
164 my($wstatus) = system($system);
165 - if ($f eq "lynx") {
166 - # lynx returns 0 when it fails somewhere
167 + if ($f eq "links") {
168 + # links returns 0 when it fails somewhere
169 if (-s $asl_ungz) {
170 my $content = do { local *FH;
171 open FH, $asl_ungz or die;
172 @@ -4363,7 +4363,7 @@ Trying with "$funkyftp$src_switch" to ge
173 <FH> };
174 if ($content =~ /^<.*(<title>[45]|Error [45])/si) {
175 $CPAN::Frontend->mywarn(qq{
176 -No success, the file that lynx has downloaded looks like an error message:
177 +No success, the file that links has downloaded looks like an error message:
178 $content
179 });
180 $CPAN::Frontend->mysleep(1);
181 @@ -4371,7 +4371,7 @@ $content
182 }
183 } else {
184 $CPAN::Frontend->myprint(qq{
185 -No success, the file that lynx has downloaded is an empty file.
186 +No success, the file that links has downloaded is an empty file.
187 });
188 next DLPRG;
189 }
190 @@ -9081,14 +9081,14 @@ sub _display_url {
191 # should we define it in the config instead?
192 my $html_converter = "html2text.pl";
193
194 - my $web_browser = $CPAN::Config->{'lynx'} || undef;
195 + my $web_browser = $CPAN::Config->{'links'} || undef;
196 my $web_browser_out = $web_browser
197 ? CPAN::Distribution->_check_binary($self,$web_browser)
198 : undef;
199
200 if ($web_browser_out) {
201 # web browser found, run the action
202 - my $browser = CPAN::HandleConfig->safe_quote($CPAN::Config->{'lynx'});
203 + my $browser = CPAN::HandleConfig->safe_quote($CPAN::Config->{'links'});
204 $CPAN::Frontend->myprint(qq{system[$browser $url]})
205 if $CPAN::DEBUG;
206 $CPAN::Frontend->myprint(qq{
207 @@ -9163,7 +9163,7 @@ with pager "$pager"
208 } else {
209 # coldn't find the web browser or html converter
210 $CPAN::Frontend->myprint(qq{
211 -You need to install lynx or $html_converter to use this feature.});
212 +You need to install links or $html_converter to use this feature.});
213 }
214 }
215 }
216 @@ -10837,7 +10837,7 @@ defined:
217 keep_source_where directory in which to keep the source (if we do)
218 load_module_verbosity
219 report loading of optional modules used by CPAN.pm
220 - lynx path to external prg
221 + links path to external prg
222 make location of external make program
223 make_arg arguments that should always be passed to 'make'
224 make_install_make_command
225 @@ -11666,7 +11666,7 @@ Makefile.PL> or C<perl Build.PL> and C<m
226
227 Downloads the pod documentation of the file associated with a
228 distribution (in html format) and runs it through the external
229 -command lynx specified in C<$CPAN::Config->{lynx}>. If lynx
230 +command links specified in C<$CPAN::Config->{links}>. If links
231 isn't available, it converts it to plain text with external
232 command html2text and runs it through the pager specified
233 in C<$CPAN::Config->{pager}>
234 @@ -11975,7 +11975,7 @@ required for non-UNIX systems or if your
235 associated with a URL that is not C<ftp:>.
236
237 If you have neither Net::FTP nor LWP, there is a fallback mechanism
238 -implemented for an external ftp command or for an external lynx
239 +implemented for an external ftp command or for an external links
240 command.
241
242 =head1 UTILITIES
243 @@ -12247,16 +12247,16 @@ ftp_passive to a true value.
244
245 =back
246
247 -=head2 Configuring lynx or ncftp for going through a firewall
248 +=head2 Configuring links or ncftp for going through a firewall
249
250 -If you can go through your firewall with e.g. lynx, presumably with a
251 +If you can go through your firewall with e.g. links, presumably with a
252 command such as
253
254 - /usr/local/bin/lynx -pscott:tiger
255 + /usr/local/bin/links -pscott:tiger
256
257 then you would configure CPAN.pm with the command
258
259 - o conf lynx "/usr/local/bin/lynx -pscott:tiger"
260 + o conf links "/usr/local/bin/links -pscott:tiger"
261
262 That's all. Similarly for ncftp or ftp, you would configure something
263 like
264 diff -up perl-5.10.0/lib/CPAN/HandleConfig.pm.BAD perl-5.10.0/lib/CPAN/HandleConfig.pm
265 --- perl-5.10.0.orig/lib/CPAN/HandleConfig.pm 2007-12-18 11:47:07.000000000 +0100
266 +++ perl-5.10.0/lib/CPAN/HandleConfig.pm 2009-03-11 14:21:21.000000000 +0100
267 @@ -49,7 +49,7 @@ $VERSION = sprintf "%.6f", substr(q$Rev:
268 "inhibit_startup_message",
269 "keep_source_where",
270 "load_module_verbosity",
271 - "lynx",
272 + "links",
273 "make",
274 "make_arg",
275 "make_install_arg",
276 diff -up perl-5.10.0/lib/CPAN/FirstTime.pm.BAD perl-5.10.0/lib/CPAN/FirstTime.pm
277 --- perl-5.10.0.orig/lib/CPAN/FirstTime.pm 2007-12-18 11:47:07.000000000 +0100
278 +++ perl-5.10.0/lib/CPAN/FirstTime.pm 2009-03-11 14:21:21.000000000 +0100
279 @@ -813,7 +813,7 @@ Shall we use it as the general CPAN buil
280
281 make
282
283 - curl lynx wget ncftpget ncftp ftp
284 + curl links wget ncftpget ncftp ftp
285
286 gpg
287
288 diff -up perl-5.10.0/pod/perltoc.pod.BAD perl-5.10.0/pod/perltoc.pod
289 --- perl-5.10.0.orig/pod/perltoc.pod 2007-12-18 11:47:08.000000000 +0100
290 +++ perl-5.10.0/pod/perltoc.pod 2009-03-11 14:21:21.000000000 +0100
291 @@ -14682,7 +14682,7 @@ has_inst($module), has_usable($module),
292
293 http firewall, ftp firewall, One way visibility, SOCKS, IP Masquerade
294
295 -=item Configuring lynx or ncftp for going through a firewall
296 +=item Configuring links or ncftp for going through a firewall
297
298 =back
299
300 @@ -20857,7 +20857,7 @@ $ff->output_file
301
302 =item So how do I use a proxy with File::Fetch?
303
304 -=item I used 'lynx' to fetch a file, but its contents is all wrong!
305 +=item I used 'links' to fetch a file, but its contents is all wrong!
306
307 =item Files I'm trying to fetch have reserved characters or non-ASCII
308 characters in them. What do I do?
309 diff -up perl-5.10.0/pod/perlfaq9.pod.BAD perl-5.10.0/pod/perlfaq9.pod
310 --- perl-5.10.0.orig/pod/perlfaq9.pod 2007-12-18 11:47:08.000000000 +0100
311 +++ perl-5.10.0/pod/perlfaq9.pod 2009-03-11 14:21:21.000000000 +0100
312 @@ -212,14 +212,14 @@ examples.
313
314 =head2 How do I fetch an HTML file?
315
316 -One approach, if you have the lynx text-based HTML browser installed
317 +One approach, if you have the links text-based HTML browser installed
318 on your system, is this:
319
320 - $html_code = `lynx -source $url`;
321 - $text_data = `lynx -dump $url`;
322 + $html_code = `links -source $url`;
323 + $text_data = `links -dump $url`;
324
325 The libwww-perl (LWP) modules from CPAN provide a more powerful way
326 -to do this. They don't require lynx, but like lynx, can still work
327 +to do this. They don't require links, but like links, can still work
328 through proxies:
329
330 # simplest version

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2