.gear/rules | 2 + .../tags/e05ee97f66b36972ecb259a504022c4fb89a591b | 13 + .gear/tags/list | 1 + bin/lwp-request | 16 +- lib/HTTP/Headers.pm | 12 +- lib/HTTP/Message.pm | 2 +- lib/LWP/MediaTypes.pm | 1 + lib/LWP/Protocol/ftp.pm | 11 +- lib/LWP/Protocol/https10.pm | 10 +- lib/Net/HTTP/Methods.pm | 26 +-- lib/Net/HTTPS.pm | 17 +-- perl-libwww.spec | 230 ++++++++++++++++++++ 12 files changed, 263 insertions(+), 78 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..b0a954c --- /dev/null +++ b/.gear/rules @@ -0,0 +1,2 @@ +tar: @version@:. name=libwww-perl-@version@ +diff: @version@:. . name=perl-libwww-@version@-@release@.patch diff --git a/.gear/tags/e05ee97f66b36972ecb259a504022c4fb89a591b b/.gear/tags/e05ee97f66b36972ecb259a504022c4fb89a591b new file mode 100644 index 0000000..df526f8 --- /dev/null +++ b/.gear/tags/e05ee97f66b36972ecb259a504022c4fb89a591b @@ -0,0 +1,13 @@ +object d1d06981c91c44333ec80555f83fd23c653a1396 +type commit +tag 5.826 +tagger Alexey Tourbin 1240940913 +0400 + +5.826 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iEYEABECAAYFAkn3QXEACgkQfBKgtDjnu0YA+QCeK2qe1WZDbXlhF2H1rGRe0fCw +askAn1Ldj4JCbjRSaGsjbcBAjspXBKWz +=syjE +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..432125f --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +e05ee97f66b36972ecb259a504022c4fb89a591b 5.826 diff --git a/bin/lwp-request b/bin/lwp-request index 7faaaa6..2cc3cbf 100755 --- a/bin/lwp-request +++ b/bin/lwp-request @@ -440,27 +440,17 @@ while ($url = shift) { unless ($options{'d'}) { if ($options{'o'} && $response->content_type eq 'text/html') { - eval { - require HTML::Parse; - }; - if ($@) { - if ($@ =~ m,^Can't locate HTML/Parse.pm in \@INC,) { - die "The HTML-Tree distribution need to be installed for the -o option to be used.\n"; - } - else { - die $@; - } - } + eval { require HTML::Parse; } or die $@; my $html = HTML::Parse::parse_html($response->content); { $options{'o'} eq 'ps' && do { - require HTML::FormatPS; + eval {require HTML::FormatPS; } or die $@; my $f = HTML::FormatPS->new; print $f->format($html); last; }; $options{'o'} eq 'text' && do { - require HTML::FormatText; + eval { require HTML::FormatText; } or die $@; my $f = HTML::FormatText->new; print $f->format($html); last; diff --git a/lib/HTTP/Headers.pm b/lib/HTTP/Headers.pm index 164706a..5f5a99d 100644 --- a/lib/HTTP/Headers.pm +++ b/lib/HTTP/Headers.pm @@ -257,15 +257,9 @@ sub as_string } -if (eval { require Storable; 1 }) { - *clone = \&Storable::dclone; -} else { - *clone = sub { - my $self = shift; - my $clone = new HTTP::Headers; - $self->scan(sub { $clone->push_header(@_);} ); - $clone; - }; +sub clone { + require Storable; + goto &Storable::dclone; } diff --git a/lib/HTTP/Message.pm b/lib/HTTP/Message.pm index b1e1609..059b624 100644 --- a/lib/HTTP/Message.pm +++ b/lib/HTTP/Message.pm @@ -385,7 +385,7 @@ sub encode $content = Compress::Zlib::compress($content); } elsif ($encoding eq "x-bzip2") { - require Compress::Bzip2; + eval { require Compress::Bzip2; } or die $@; $content = Compress::Bzip2::memGzip($content); } elsif ($encoding eq "rot13") { # for the fun of it diff --git a/lib/LWP/MediaTypes.pm b/lib/LWP/MediaTypes.pm index a357c29..d19e3af 100644 --- a/lib/LWP/MediaTypes.pm +++ b/lib/LWP/MediaTypes.pm @@ -198,6 +198,7 @@ sub read_media_types add_type($type, @exts); } close(TYPE); + last if $ENV{RPM_BUILD_ROOT}; } } diff --git a/lib/LWP/Protocol/ftp.pm b/lib/LWP/Protocol/ftp.pm index 0e4744e..69e47db 100644 --- a/lib/LWP/Protocol/ftp.pm +++ b/lib/LWP/Protocol/ftp.pm @@ -15,7 +15,7 @@ require LWP::Protocol; @ISA = qw(LWP::Protocol); use strict; -eval { +{ package LWP::Protocol::MyFTP; require Net::FTP; @@ -68,9 +68,7 @@ eval { my $self = shift; return $self->go_home; } - -}; -my $init_failed = $@; +} sub _connect { @@ -149,11 +147,6 @@ sub request "$method for 'ftp:' URLs"); } - if ($init_failed) { - return HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERVER_ERROR, - $init_failed); - } - my $host = $url->host; my $port = $url->port; my $user = $url->user; diff --git a/lib/LWP/Protocol/https10.pm b/lib/LWP/Protocol/https10.pm index 662ba76..67807f9 100644 --- a/lib/LWP/Protocol/https10.pm +++ b/lib/LWP/Protocol/https10.pm @@ -11,14 +11,8 @@ elsif ($IO::Socket::SSL::VERSION) { $SSL_CLASS = "IO::Socket::SSL"; # it was already loaded } else { - eval { require Net::SSL; }; # from Crypt-SSLeay - if ($@) { - require IO::Socket::SSL; - $SSL_CLASS = "IO::Socket::SSL"; - } - else { - $SSL_CLASS = "Net::SSL"; - } + require Net::SSL; # from Crypt-SSLeay + $SSL_CLASS = "Net::SSL"; } diff --git a/lib/Net/HTTP/Methods.pm b/lib/Net/HTTP/Methods.pm index d2edd26..3656ef3 100644 --- a/lib/Net/HTTP/Methods.pm +++ b/lib/Net/HTTP/Methods.pm @@ -9,6 +9,8 @@ $VERSION = "5.824"; my $CRLF = "\015\012"; # "\r\n" is not portable +sub zlib_ok () { require Compress::Zlib } + *_bytes = defined(&utf8::downgrade) ? sub { unless (utf8::downgrade($_[0], 1)) { @@ -162,7 +164,7 @@ sub format_request { if ($given{te}) { push(@connection, "TE") unless grep lc($_) eq "te", @connection; } - elsif ($self->send_te && zlib_ok()) { + elsif ($self->send_te) { # gzip is less wanted since the Compress::Zlib interface for # it does not really allow chunked decoding to take place easily. push(@h2, "TE: deflate,gzip;q=0.3"); @@ -547,26 +549,4 @@ sub get_trailers { @{${*$self}{'http_trailers'} || []}; } -BEGIN { -my $zlib_ok; - -sub zlib_ok { - return $zlib_ok if defined $zlib_ok; - - # Try to load Compress::Zlib. - local $@; - local $SIG{__DIE__}; - $zlib_ok = 0; - - eval { - require Compress::Zlib; - Compress::Zlib->VERSION(1.10); - $zlib_ok++; - }; - - return $zlib_ok; -} - -} # BEGIN - 1; diff --git a/lib/Net/HTTPS.pm b/lib/Net/HTTPS.pm index bfed714..c557986 100644 --- a/lib/Net/HTTPS.pm +++ b/lib/Net/HTTPS.pm @@ -16,21 +16,8 @@ elsif ($IO::Socket::SSL::VERSION) { $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded } else { - eval { require Net::SSL; }; # from Crypt-SSLeay - if ($@) { - my $old_errsv = $@; - eval { - require IO::Socket::SSL; - }; - if ($@) { - $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g; - die $old_errsv . $@; - } - $SSL_SOCKET_CLASS = "IO::Socket::SSL"; - } - else { - $SSL_SOCKET_CLASS = "Net::SSL"; - } + require Net::SSL; # from Crypt-SSLeay + $SSL_SOCKET_CLASS = "Net::SSL"; } require Net::HTTP::Methods; diff --git a/perl-libwww.spec b/perl-libwww.spec new file mode 100644 index 0000000..100090d --- /dev/null +++ b/perl-libwww.spec @@ -0,0 +1,230 @@ +%define dist libwww-perl +Name: perl-libwww +Version: 5.826 +Release: alt1 + +Summary: WWW client/server library for Perl (aka LWP) +License: GPL or Artistic +Group: Development/Perl + +URL: %CPAN %dist +Source: %dist-%version.tar +Patch: %name-%version-%release.patch + +BuildArch: noarch + +Provides: %name-perl = %version +Obsoletes: %name-perl < %version + +# requires Win32 +%add_findreq_skiplist */HTTP/Cookies/Microsoft.pm +# requires Authen::NTLM; not required by any package +%add_findreq_skiplist */LWP/Authen/Ntlm.pm +# requires HTTP::GHTTP; not required by any package +%add_findreq_skiplist */LWP/Protocol/GHTTP.pm + +# XXX for $response->decoded_content +#Requires: perl-Encode + +# break dependency loop +Requires: perl-HTML-Parser + +# Automatically added by buildreq on Tue Apr 28 2009 +BuildRequires: perl-Compress-Bzip2 perl-Compress-Zlib perl-DBM perl-Encode perl-HTML-Parser perl-Storable perl-devel + +%description +The libwww-perl collection is a set of Perl modules which provides a +simple and consistent application programming interface to the +World-Wide Web. The main focus of the library is to provide classes +and functions that allow you to write WWW clients. The library also +contain modules that are of more general use and even classes that +help you implement simple HTTP servers. + +%prep +%setup -q -n %dist-%version +%patch -p1 +bzip2 -9fk Changes + +%build +%perl_vendor_build + +%install +%perl_vendor_install + +ln -snf lwp-request %buildroot%_bindir/GET +ln -snf lwp-request %buildroot%_bindir/HEAD +ln -snf lwp-request %buildroot%_bindir/POST + +ln -snf lwp-request.1 %buildroot%_man1dir/GET.1 +ln -snf lwp-request.1 %buildroot%_man1dir/HEAD.1 +ln -snf lwp-request.1 %buildroot%_man1dir/POST.1 + +%files +%doc Changes.bz2 README README.SSL + %_bindir/lwp-* + %_bindir/GET + %_bindir/HEAD + %_bindir/POST + %_man1dir/lwp-*.* + %_man1dir/GET.* + %_man1dir/HEAD.* + %_man1dir/POST.* +%dir %perl_vendor_privlib/LWP + %perl_vendor_privlib/LWP.pm + %perl_vendor_privlib/LWP/* +%dir %perl_vendor_privlib/Net + %perl_vendor_privlib/Net/HTTP* +%dir %perl_vendor_privlib/WWW + %perl_vendor_privlib/WWW/RobotRules* +%dir %perl_vendor_privlib/HTML + %perl_vendor_privlib/HTML/Form.pm +%dir %perl_vendor_privlib/HTTP + %perl_vendor_privlib/HTTP/* +%dir %perl_vendor_privlib/File + %perl_vendor_privlib/File/Listing.pm +%dir %perl_vendor_privlib/Bundle + %perl_vendor_privlib/Bundle/LWP.pm +%doc %perl_vendor_privlib/lwp*.pod + +%changelog +* Tue Apr 28 2009 Alexey Tourbin 5.826-alt1 +- 5.824 -> 5.826 + +* Sat Feb 14 2009 Alexey Tourbin 5.824-alt1 +- 5.821 -> 5.824 + +* Tue Dec 16 2008 Alexey Tourbin 5.821-alt2 +- backported bugfixes from 5.822 + +* Tue Nov 25 2008 Alexey Tourbin 5.821-alt1 +- 5.820 -> 5.821 + +* Thu Nov 06 2008 Alexey Tourbin 5.820-alt1 +- 5.817 -> 5.820 +- HTTP/Headers.pm (clone) now requires Storable.pm + +* Sat Oct 11 2008 Alexey Tourbin 5.817-alt1 +- 5.815 -> 5.817 + +* Thu Sep 25 2008 Alexey Tourbin 5.815-alt1 +- 5.814 -> 5.815 + +* Sat Aug 09 2008 Alexey Tourbin 5.814-alt1 +- 5.813 -> 5.814 + +* Thu Jun 19 2008 Alexey Tourbin 5.813-alt1 +- 5.812 -> 5.813 + +* Thu Apr 24 2008 Alexey Tourbin 5.812-alt1 +- 5.810 -> 5.812 + +* Sat Apr 12 2008 Alexey Tourbin 5.810-alt1 +- 5.808 -> 5.810 + +* Tue Aug 07 2007 Alexey Tourbin 5.808-alt1 +- 5.805 -> 5.808 + +* Sun Apr 08 2007 Alexey Tourbin 5.805-alt3 +- LWP/Protocol/nntp.pm (request): do not clobber $_ (rt.cpan.org #25132) +- lwp-request (POST): relaxed content-type check (#6792, cpan #26151) + +* Sun Jan 14 2007 Alexey Tourbin 5.805-alt2 +- imported sources into git and adapted for gear +- lwp-request: relaxed dependencies on perl-HTML-Format +- lwp-request: debian patch for -b option (deb #294595) + +* Mon May 22 2006 Alexey Tourbin 5.805-alt1 +- 5.803 -> 5.805 +- restored manual pages for GET, HEAD, etc. + +* Wed Jun 22 2005 Alexey Tourbin 5.803-alt3 +- fixed alt-deps-ftp.patch (breakage reported by Ivan Adzhubey) + +* Fri Apr 15 2005 Alexey Tourbin 5.803-alt2 +- patched to clarify dependencies on Compress::Zlib, Net::FTP, and Net::SSL + +* Wed Dec 22 2004 Alexey Tourbin 5.803-alt1 +- 5.79 -> 5.803 +- renamed: %name-perl -> %name +- manual pages not packaged (use perldoc) + +* Thu Apr 15 2004 Alexey Tourbin 5.79-alt1 +- 5.76 -> 5.79 + +* Sat Dec 06 2003 Alexey Tourbin 5.76-alt1 +- 5.76 + +* Thu Nov 13 2003 Alexey Tourbin 5.75-alt1 +- 5.75 +- mdk-empty_header.patch merged upstream, alt-syntax.patch needed no more +- alt-makefile.patch updated (not to read media.types of already installed + package when running tests) + +* Fri Oct 17 2003 Alexey Tourbin 5.72-alt1 +- 5.72 +- syntax.patch: fix syntax error +- makefile.patch: + + don't run "live" tests + + don't look for the existing installation + +* Sat Apr 26 2003 Alexey Tourbin 5.69-alt2 +- skip dependencies in: + + LWP/Authen/Ntlm.pm (requires Authen/Ntlm.pm) + + HTTP/Cookies/Microsoft.pm (requires Win32.pm) + + LWP/Protocol/GHTTP.pm +- specfile cleanup + +* Tue Mar 18 2003 Stanislav Ievlev 5.69-alt1 +- 5.69 + +* Tue Oct 29 2002 Alexey Tourbin 5.65-alt2 +- rebuilt for perl-5.8 with new rpm macros + +* Thu Jun 13 2002 Stanislav Ievlev 5.65-alt1 +- 5.65 + +* Wed Apr 03 2002 Stanislav Ievlev 5.64-alt1 +- 5.64 + +* Thu Dec 20 2001 Stanislav Ievlev 5.63-alt1 +- 5.63 + +* Mon Oct 15 2001 Stanislav Ievlev 5.53-alt1 +- 5.53 + +* Mon Jun 25 2001 Konstantin Volckov 5.50-ipl2mdk +- Rebuilt with perl-5.6.1 +- Some spec cleanup + +* Mon Jan 29 2001 Mikhail Zabaluev 5.50-ipl1mdk +- Updated: + + version 5.50 +- Changed: + + spec file adapted for Sisyphus +- Fixed: + + perl path in LWP/Debug.pm + +* Wed Jun 28 2000 Mikhail Zabaluev 5.48-1mdk_mhz +- changed file list and installation +- added description from README +- force build architecture to noarch + +* Thu Apr 20 2000 Guillaume Cottenceau 5.47-3mdk +- fixed release tag + +* Fri Mar 31 2000 Pixel 5.47-2mdk +- remove file list +- rebuild for 5.6.0 + +* Mon Jan 3 2000 Jean-Michel Dault +- final cleanup for Mandrake 7 + +* Thu Dec 30 1999 Jean-Michel Dault +- updated to 5.47 + +* Sun Aug 29 1999 Jean-Michel Dault +- bzip2'd sources +- updated to 5.44 + +* Tue May 11 1999 root +- Spec file was autogenerated.