commit f17f835e36112a5a4331837bc359af797c623c62 Author: Jan Rękorajski <bagg...@pld-linux.org> Date: Tue Feb 22 01:22:38 2022 +0100
- fix https fetch, rel 5 pldcpan.pl | 14 +++++++++----- pldcpan.spec | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) --- diff --git a/pldcpan.spec b/pldcpan.spec index ccdeda9..6d619e3 100644 --- a/pldcpan.spec +++ b/pldcpan.spec @@ -2,7 +2,7 @@ Summary: PLD Linux script to create RPMS from CPAN modules Summary(pl.UTF-8): Skrypt PLD tworzący pakiety RPM z modułów z CPAN Name: pldcpan Version: 1.65 -Release: 4 +Release: 5 License: GPL Group: Development/Languages/Perl Source0: %{name}.pl @@ -12,6 +12,7 @@ BuildRequires: rpm-perlprov >= 4.1-13 Requires: perl-Data-Dump Requires: perl-Encode Requires: perl-LWP-Protocol-https +Requires: perl-Crypt-SSLeay Requires: perl-libwww BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) diff --git a/pldcpan.pl b/pldcpan.pl index aba524e..347d650 100755 --- a/pldcpan.pl +++ b/pldcpan.pl @@ -77,6 +77,9 @@ use IO::String (); use File::Find::Rule (); use Module::CoreList (); use LWP::Simple (); +use LWP::UserAgent (); + +$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; our $VERSION = 1.65; our %opts; @@ -666,12 +669,13 @@ for my $arg (@ARGV) { my $dist = $arg; $dist =~ s/-/::/g if $dist =~ /-/; warn " -- searching for '$dist' on metacpan.org\n"; - my $scpan = LWP::Simple::get("https://fastapi.metacpan.org/v1/download_url/$dist"); - if ( !defined $scpan - || $scpan =~ /Not found/ - || $scpan !~ m#"download_url" : ".*/authors/id/([^"]+/([^/"]+))"#) + my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0, }); + my $scpan = $ua->get("https://fastapi.metacpan.org/v1/download_url/$dist"); + if ( !$scpan->is_success + || $scpan->decoded_content =~ /Not found/ + || $scpan->decoded_content !~ m#"download_url" : ".*/authors/id/([^"]+/([^/"]+))"#) { - warn " !! searching for '$dist' on metacpan.org failed\n"; + warn " !! searching for '$dist' on metacpan.org failed: $scpan->status_line\n"; next; } $info->{url} = "http://www.cpan.org/modules/by-authors/id/$1"; ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/pldcpan.git/commitdiff/f17f835e36112a5a4331837bc359af797c623c62 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit