From cd48e086e9e14387c7abf2e45a8853b40b628793 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 6 Mar 2023 07:58:39 +0100 Subject: [PATCH] use CPAN::DistnameInfo rather than CPAN::ParseDistribution CPAN::DistnameInfo has less prereqs and matches the behavior of PAUSE. It is the standard used most other places in the CPAN ecosystem for this job. This also fixes a bug, as CPAN::ParseDistribution was being given the name of a temporary downloaded file, rather than the full CPAN path needed. --- cpanfile | 2 +- lib/Git/CPAN/Patch/Release.pm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpanfile b/cpanfile index 1400d04..d023b58 100644 --- a/cpanfile +++ b/cpanfile @@ -4,8 +4,8 @@ requires "Archive::Any" => "0"; requires "Archive::Extract" => "0"; requires "BackPAN::Index" => "0"; +requires "CPAN::DistnameInfo" => "0"; requires "CPAN::Meta" => "0"; -requires "CPAN::ParseDistribution" => "0"; requires "CPANPLUS" => "0"; requires "Cwd" => "0"; requires "DateTime" => "0"; diff --git a/lib/Git/CPAN/Patch/Release.pm b/lib/Git/CPAN/Patch/Release.pm index 1a240e9..1b9d784 100644 --- a/lib/Git/CPAN/Patch/Release.pm +++ b/lib/Git/CPAN/Patch/Release.pm @@ -155,13 +155,13 @@ has extracted_dir => ( }, ); -has cpan_parse => ( +has name_info => ( is => 'ro', - predicate => 'has_cpan_parse', + predicate => 'has_name_info', lazy => 1, default => sub($self) { - require CPAN::ParseDistribution; - CPAN::ParseDistribution->new( $self->tarball ); + require CPAN::DistnameInfo; + CPAN::DistnameInfo->new( $self->download_url ); }, ); @@ -210,7 +210,7 @@ has dist_version => ( default => sub($self) { $self->has_meta_info ? $self->meta_info->{version} - : $self->cpan_parse->distversion + : $self->name_info->version }, ); @@ -220,7 +220,7 @@ has dist_name => ( default => sub($self) { $self->has_meta_info ? $self->meta_info->{distribution} || $self->meta_info->{name} - : $self->cpan_parse->dist + : $self->name_info->dist ; }, );