diff -Nru libcpan-meta-requirements-perl-2.140/Changes libcpan-meta-requirements-perl-2.143/Changes --- libcpan-meta-requirements-perl-2.140/Changes 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/Changes 2023-06-19 18:51:59.000000000 +0000 @@ -1,5 +1,18 @@ Revision history for CPAN-Meta-Requirements +2.143 2023-06-19 14:51:58-04:00 America/New_York + - Fix regression with implicit minimum value and multiple requirements + +2.142 2023-05-09 07:15:05-04:00 America/New_York + - no changes since previous trial releae + - note: this version now requires perl v5.10 rather than v5.6 + +2.141 2023-04-30 15:42:35+02:00 Europe/Paris (TRIAL RELEASE) + - confess() replaced with croak(): fewer stack traces + - broke the version range handling into the Range class (thanks, Leon + Timmermans!) + - note: this version now requires perl v5.10 rather than v5.6 + 2.140 2015-12-12 16:17:15-05:00 America/New_York - no changes from 2.139 diff -Nru libcpan-meta-requirements-perl-2.140/cpanfile libcpan-meta-requirements-perl-2.143/cpanfile --- libcpan-meta-requirements-perl-2.140/cpanfile 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/cpanfile 2023-06-19 18:51:59.000000000 +0000 @@ -1,6 +1,9 @@ +# This file is generated by Dist::Zilla::Plugin::CPANFile v6.030 +# Do not edit this file directly. To change prereqs, edit the `dist.ini` file. + requires "B" => "0"; requires "Carp" => "0"; -requires "perl" => "5.006"; +requires "perl" => "v5.10.0"; requires "strict" => "0"; requires "version" => "0.88"; requires "warnings" => "0"; @@ -9,7 +12,7 @@ requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "Test::More" => "0.88"; - requires "perl" => "5.006"; + requires "perl" => "v5.10.0"; requires "version" => "0.88"; }; @@ -19,7 +22,7 @@ on 'configure' => sub { requires "ExtUtils::MakeMaker" => "6.17"; - requires "perl" => "5.006"; + requires "perl" => "v5.10.0"; }; on 'develop' => sub { @@ -76,19 +79,21 @@ requires "Dist::Zilla::Plugin::Test::Version" => "0"; requires "Dist::Zilla::Plugin::TestRelease" => "0"; requires "Dist::Zilla::Plugin::UploadToCPAN" => "0"; - requires "English" => "0"; requires "File::Spec" => "0"; requires "File::Temp" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Pod::Coverage::TrustPod" => "0"; + requires "Pod::Weaver::PluginBundle::DAGOLDEN" => "0"; requires "Pod::Wordlist" => "0"; requires "Software::License::Perl_5" => "0"; requires "Test::CPAN::Meta" => "0"; + requires "Test::MinimumVersion" => "0"; requires "Test::More" => "0"; + requires "Test::Perl::Critic" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; + requires "Test::Portability::Files" => "0"; requires "Test::Spelling" => "0.12"; requires "Test::Version" => "1"; - requires "blib" => "1.01"; }; diff -Nru libcpan-meta-requirements-perl-2.140/debian/changelog libcpan-meta-requirements-perl-2.143/debian/changelog --- libcpan-meta-requirements-perl-2.140/debian/changelog 2022-06-12 21:04:41.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/debian/changelog 2023-06-26 18:16:11.000000000 +0000 @@ -1,3 +1,14 @@ +libcpan-meta-requirements-perl (2.143-1) unstable; urgency=medium + + * Import upstream version 2.143. + * Update years of packaging copyright. + * Update alternative (test) dependencies. + * Declare compliance with Debian Policy 4.6.2. + * Set Rules-Requires-Root: no. + * Annotate test-only build dependencies with . + + -- gregor herrmann Mon, 26 Jun 2023 20:16:11 +0200 + libcpan-meta-requirements-perl (2.140-2) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru libcpan-meta-requirements-perl-2.140/debian/control libcpan-meta-requirements-perl-2.143/debian/control --- libcpan-meta-requirements-perl-2.140/debian/control 2022-06-12 21:04:41.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/debian/control 2023-06-26 18:16:11.000000000 +0000 @@ -2,21 +2,22 @@ Maintainer: Debian Perl Group Uploaders: gregor herrmann Section: perl +Testsuite: autopkgtest-pkg-perl Priority: optional Build-Depends: debhelper-compat (= 13) -Build-Depends-Indep: perl, - perl | libversion-perl -Standards-Version: 3.9.6 +Build-Depends-Indep: libversion-perl , + perl +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libcpan-meta-requirements-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libcpan-meta-requirements-perl.git -Testsuite: autopkgtest-pkg-perl Homepage: https://metacpan.org/release/CPAN-Meta-Requirements +Rules-Requires-Root: no Package: libcpan-meta-requirements-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, - perl | libversion-perl + libversion-perl Description: set of version requirements for a CPAN dist A CPAN::Meta::Requirements object models a set of version constraints like those specified in the META.yml or META.json files in CPAN distributions. It diff -Nru libcpan-meta-requirements-perl-2.140/debian/copyright libcpan-meta-requirements-perl-2.143/debian/copyright --- libcpan-meta-requirements-perl-2.140/debian/copyright 2022-06-12 21:04:41.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/debian/copyright 2023-06-26 18:16:11.000000000 +0000 @@ -9,7 +9,7 @@ License: Artistic or GPL-1+ Files: debian/* -Copyright: 2012-2015, gregor herrmann +Copyright: 2012-2023, gregor herrmann License: Artistic or GPL-1+ License: Artistic diff -Nru libcpan-meta-requirements-perl-2.140/dist.ini libcpan-meta-requirements-perl-2.143/dist.ini --- libcpan-meta-requirements-perl-2.140/dist.ini 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/dist.ini 2023-06-19 18:51:59.000000000 +0000 @@ -36,7 +36,7 @@ xt_mode = 1 [Test::MinimumVersion / Dist::Zilla::PluginBundle::DAGOLDEN/Test::MinimumVersion] -max_target_perl = 5.006 +max_target_perl = 5.010 [Test::ReportPrereqs / Dist::Zilla::PluginBundle::DAGOLDEN/Test::ReportPrereqs] @@ -82,6 +82,7 @@ remote = github [Prereqs::AuthorDeps / Dist::Zilla::PluginBundle::DAGOLDEN/Prereqs::AuthorDeps] +; authordep Pod::Weaver::PluginBundle::DAGOLDEN [MetaYAML / Dist::Zilla::PluginBundle::DAGOLDEN/MetaYAML] @@ -100,7 +101,6 @@ [PromptIfStale / Dist::Zilla::PluginBundle::DAGOLDEN/PromptIfStale] check_all_plugins = 1 modules = Dist::Zilla -modules = Dist::Zilla::PluginBundle::DAGOLDEN [CopyFilesFromBuild::Filtered / Dist::Zilla::PluginBundle::DAGOLDEN/CopyFilesFromBuild::Filtered] copy = Makefile.PL @@ -108,6 +108,7 @@ [Manifest / Dist::Zilla::PluginBundle::DAGOLDEN/Manifest] [Git::CheckFor::CorrectBranch / Dist::Zilla::PluginBundle::DAGOLDEN/Git::CheckFor::CorrectBranch] +release_branch = main [Git::Check / Dist::Zilla::PluginBundle::DAGOLDEN/Git::Check] allow_dirty = Makefile.PL @@ -145,7 +146,7 @@ commit_msg = After release: bump $VERSION and timestamp Changes [Git::Push / Dist::Zilla::PluginBundle::DAGOLDEN/Git::Push] -push_to = origin +push_to = github [MakeMaker::Highlander] :version = 0.003 diff -Nru libcpan-meta-requirements-perl-2.140/lib/CPAN/Meta/Requirements/Range.pm libcpan-meta-requirements-perl-2.143/lib/CPAN/Meta/Requirements/Range.pm --- libcpan-meta-requirements-perl-2.140/lib/CPAN/Meta/Requirements/Range.pm 1970-01-01 00:00:00.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/lib/CPAN/Meta/Requirements/Range.pm 2023-06-19 18:51:59.000000000 +0000 @@ -0,0 +1,776 @@ +use v5.10; +use strict; +use warnings; +package CPAN::Meta::Requirements::Range; +# ABSTRACT: a set of version requirements for a CPAN dist + +our $VERSION = '2.143'; + +use Carp (); + +#pod =head1 SYNOPSIS +#pod +#pod use CPAN::Meta::Requirements::Range; +#pod +#pod my $range = CPAN::Meta::Requirements::Range->with_minimum(1); +#pod +#pod $range = $range->with_maximum('v2.2'); +#pod +#pod my $stringified = $range->as_string; +#pod +#pod =head1 DESCRIPTION +#pod +#pod A CPAN::Meta::Requirements::Range object models a set of version constraints like +#pod those specified in the F or F files in CPAN distributions, +#pod and as defined by L; +#pod It can be built up by adding more and more constraints, and it will reduce them +#pod to the simplest representation. +#pod +#pod Logically impossible constraints will be identified immediately by thrown +#pod exceptions. +#pod +#pod =cut + +use Carp (); + +package + CPAN::Meta::Requirements::Range::_Base; + +# To help ExtUtils::MakeMaker bootstrap CPAN::Meta::Requirements on perls +# before 5.10, we fall back to the EUMM bundled compatibility version module if +# that's the only thing available. This shouldn't ever happen in a normal CPAN +# install of CPAN::Meta::Requirements, as version.pm will be picked up from +# prereqs and be available at runtime. + +BEGIN { + eval "use version ()"; ## no critic + if ( my $err = $@ ) { + eval "use ExtUtils::MakeMaker::version" or die $err; ## no critic + } +} + +# from version::vpp +sub _find_magic_vstring { + my $value = shift; + my $tvalue = ''; + require B; + my $sv = B::svref_2object(\$value); + my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef; + while ( $magic ) { + if ( $magic->TYPE eq 'V' ) { + $tvalue = $magic->PTR; + $tvalue =~ s/^v?(.+)$/v$1/; + last; + } + else { + $magic = $magic->MOREMAGIC; + } + } + return $tvalue; +} + +# Perl 5.10.0 didn't have "is_qv" in version.pm +*_is_qv = version->can('is_qv') ? sub { $_[0]->is_qv } : sub { exists $_[0]->{qv} }; + +# construct once, reuse many times +my $V0 = version->new(0); + +# safe if given an unblessed reference +sub _isa_version { + UNIVERSAL::isa( $_[0], 'UNIVERSAL' ) && $_[0]->isa('version') +} + +sub _version_object { + my ($self, $version, $module, $bad_version_hook) = @_; + + my ($vobj, $err); + + if (not defined $version or (!ref($version) && $version eq '0')) { + return $V0; + } + elsif ( ref($version) eq 'version' || ( ref($version) && _isa_version($version) ) ) { + $vobj = $version; + } + else { + # hack around version::vpp not handling <3 character vstring literals + if ( $INC{'version/vpp.pm'} || $INC{'ExtUtils/MakeMaker/version/vpp.pm'} ) { + my $magic = _find_magic_vstring( $version ); + $version = $magic if length $magic; + } + # pad to 3 characters if before 5.8.1 and appears to be a v-string + if ( $] < 5.008001 && $version !~ /\A[0-9]/ && substr($version,0,1) ne 'v' && length($version) < 3 ) { + $version .= "\0" x (3 - length($version)); + } + eval { + local $SIG{__WARN__} = sub { die "Invalid version: $_[0]" }; + # avoid specific segfault on some older version.pm versions + die "Invalid version: $version" if $version eq 'version'; + $vobj = version->new($version); + }; + if ( my $err = $@ ) { + $vobj = eval { $bad_version_hook->($version, $module) } + if ref $bad_version_hook eq 'CODE'; + unless (eval { $vobj->isa("version") }) { + $err =~ s{ at .* line \d+.*$}{}; + die "Can't convert '$version': $err"; + } + } + } + + # ensure no leading '.' + if ( $vobj =~ m{\A\.} ) { + $vobj = version->new("0$vobj"); + } + + # ensure normal v-string form + if ( _is_qv($vobj) ) { + $vobj = version->new($vobj->normal); + } + + return $vobj; +} + +#pod =method with_string_requirement +#pod +#pod $req->with_string_requirement('>= 1.208, <= 2.206'); +#pod $req->with_string_requirement(v1.208); +#pod +#pod This method parses the passed in string and adds the appropriate requirement. +#pod A version can be a Perl "v-string". It understands version ranges as described +#pod in the L. For example: +#pod +#pod =over 4 +#pod +#pod =item 1.3 +#pod +#pod =item >= 1.3 +#pod +#pod =item <= 1.3 +#pod +#pod =item == 1.3 +#pod +#pod =item != 1.3 +#pod +#pod =item > 1.3 +#pod +#pod =item < 1.3 +#pod +#pod =item >= 1.3, != 1.5, <= 2.0 +#pod +#pod A version number without an operator is equivalent to specifying a minimum +#pod (C=>). Extra whitespace is allowed. +#pod +#pod =back +#pod +#pod =cut + +my %methods_for_op = ( + '==' => [ qw(with_exact_version) ], + '!=' => [ qw(with_exclusion) ], + '>=' => [ qw(with_minimum) ], + '<=' => [ qw(with_maximum) ], + '>' => [ qw(with_minimum with_exclusion) ], + '<' => [ qw(with_maximum with_exclusion) ], +); + +sub with_string_requirement { + my ($self, $req, $module, $bad_version_hook) = @_; + $module //= 'module'; + + unless ( defined $req && length $req ) { + $req = 0; + Carp::carp("Undefined requirement for $module treated as '0'"); + } + + my $magic = _find_magic_vstring( $req ); + if (length $magic) { + return $self->with_minimum($magic, $module, $bad_version_hook); + } + + my @parts = split qr{\s*,\s*}, $req; + + for my $part (@parts) { + my ($op, $ver) = $part =~ m{\A\s*(==|>=|>|<=|<|!=)\s*(.*)\z}; + + if (! defined $op) { + $self = $self->with_minimum($part, $module, $bad_version_hook); + } else { + Carp::croak("illegal requirement string: $req") + unless my $methods = $methods_for_op{ $op }; + + $self = $self->$_($ver, $module, $bad_version_hook) for @$methods; + } + } + + return $self; +} + +#pod =method with_range +#pod +#pod $range->with_range($other_range) +#pod +#pod This creates a new range object that is a merge two others. +#pod +#pod =cut + +sub with_range { + my ($self, $other, $module, $bad_version_hook) = @_; + for my $modifier($other->_as_modifiers) { + my ($method, $arg) = @$modifier; + $self = $self->$method($arg, $module, $bad_version_hook); + } + return $self; +} + +package CPAN::Meta::Requirements::Range; + +our @ISA = 'CPAN::Meta::Requirements::Range::_Base'; + +sub _clone { + return (bless { } => $_[0]) unless ref $_[0]; + + my ($s) = @_; + my %guts = ( + (exists $s->{minimum} ? (minimum => version->new($s->{minimum})) : ()), + (exists $s->{maximum} ? (maximum => version->new($s->{maximum})) : ()), + + (exists $s->{exclusions} + ? (exclusions => [ map { version->new($_) } @{ $s->{exclusions} } ]) + : ()), + ); + + bless \%guts => ref($s); +} + +#pod =method with_exact_version +#pod +#pod $range->with_exact_version( $version ); +#pod +#pod This sets the version required to I the given +#pod version. No other version would be considered acceptable. +#pod +#pod This method returns the version range object. +#pod +#pod =cut + +sub with_exact_version { + my ($self, $version, $module, $bad_version_hook) = @_; + $module //= 'module'; + $self = $self->_clone; + $version = $self->_version_object($version, $module, $bad_version_hook); + + unless ($self->accepts($version)) { + $self->_reject_requirements( + $module, + "exact specification $version outside of range " . $self->as_string + ); + } + + return CPAN::Meta::Requirements::Range::_Exact->_new($version); +} + +sub _simplify { + my ($self, $module) = @_; + + if (defined $self->{minimum} and defined $self->{maximum}) { + if ($self->{minimum} == $self->{maximum}) { + if (grep { $_ == $self->{minimum} } @{ $self->{exclusions} || [] }) { + $self->_reject_requirements( + $module, + "minimum and maximum are both $self->{minimum}, which is excluded", + ); + } + + return CPAN::Meta::Requirements::Range::_Exact->_new($self->{minimum}); + } + + if ($self->{minimum} > $self->{maximum}) { + $self->_reject_requirements( + $module, + "minimum $self->{minimum} exceeds maximum $self->{maximum}", + ); + } + } + + # eliminate irrelevant exclusions + if ($self->{exclusions}) { + my %seen; + @{ $self->{exclusions} } = grep { + (! defined $self->{minimum} or $_ >= $self->{minimum}) + and + (! defined $self->{maximum} or $_ <= $self->{maximum}) + and + ! $seen{$_}++ + } @{ $self->{exclusions} }; + } + + return $self; +} + +#pod =method with_minimum +#pod +#pod $range->with_minimum( $version ); +#pod +#pod This adds a new minimum version requirement. If the new requirement is +#pod redundant to the existing specification, this has no effect. +#pod +#pod Minimum requirements are inclusive. C<$version> is required, along with any +#pod greater version number. +#pod +#pod This method returns the version range object. +#pod +#pod =cut + +sub with_minimum { + my ($self, $minimum, $module, $bad_version_hook) = @_; + $module //= 'module'; + $self = $self->_clone; + $minimum = $self->_version_object( $minimum, $module, $bad_version_hook ); + + if (defined (my $old_min = $self->{minimum})) { + $self->{minimum} = (sort { $b cmp $a } ($minimum, $old_min))[0]; + } else { + $self->{minimum} = $minimum; + } + + return $self->_simplify($module); +} + +#pod =method with_maximum +#pod +#pod $range->with_maximum( $version ); +#pod +#pod This adds a new maximum version requirement. If the new requirement is +#pod redundant to the existing specification, this has no effect. +#pod +#pod Maximum requirements are inclusive. No version strictly greater than the given +#pod version is allowed. +#pod +#pod This method returns the version range object. +#pod +#pod =cut + +sub with_maximum { + my ($self, $maximum, $module, $bad_version_hook) = @_; + $module //= 'module'; + $self = $self->_clone; + $maximum = $self->_version_object( $maximum, $module, $bad_version_hook ); + + if (defined (my $old_max = $self->{maximum})) { + $self->{maximum} = (sort { $a cmp $b } ($maximum, $old_max))[0]; + } else { + $self->{maximum} = $maximum; + } + + return $self->_simplify($module); +} + +#pod =method with_exclusion +#pod +#pod $range->with_exclusion( $version ); +#pod +#pod This adds a new excluded version. For example, you might use these three +#pod method calls: +#pod +#pod $range->with_minimum( '1.00' ); +#pod $range->with_maximum( '1.82' ); +#pod +#pod $range->with_exclusion( '1.75' ); +#pod +#pod Any version between 1.00 and 1.82 inclusive would be acceptable, except for +#pod 1.75. +#pod +#pod This method returns the requirements object. +#pod +#pod =cut + +sub with_exclusion { + my ($self, $exclusion, $module, $bad_version_hook) = @_; + $module //= 'module'; + $self = $self->_clone; + $exclusion = $self->_version_object( $exclusion, $module, $bad_version_hook ); + + push @{ $self->{exclusions} ||= [] }, $exclusion; + + return $self->_simplify($module); +} + +sub _as_modifiers { + my ($self) = @_; + my @mods; + push @mods, [ with_minimum => $self->{minimum} ] if exists $self->{minimum}; + push @mods, [ with_maximum => $self->{maximum} ] if exists $self->{maximum}; + push @mods, map {; [ with_exclusion => $_ ] } @{$self->{exclusions} || []}; + return @mods; +} + +#pod =method as_struct +#pod +#pod $range->as_struct( $module ); +#pod +#pod This returns a data structure containing the version requirements. This should +#pod not be used for version checks (see L instead). +#pod +#pod =cut + +sub as_struct { + my ($self) = @_; + + return 0 if ! keys %$self; + + my @exclusions = @{ $self->{exclusions} || [] }; + + my @parts; + + for my $tuple ( + [ qw( >= > minimum ) ], + [ qw( <= < maximum ) ], + ) { + my ($op, $e_op, $k) = @$tuple; + if (exists $self->{$k}) { + my @new_exclusions = grep { $_ != $self->{ $k } } @exclusions; + if (@new_exclusions == @exclusions) { + push @parts, [ $op, "$self->{ $k }" ]; + } else { + push @parts, [ $e_op, "$self->{ $k }" ]; + @exclusions = @new_exclusions; + } + } + } + + push @parts, map {; [ "!=", "$_" ] } @exclusions; + + return \@parts; +} + +#pod =method as_string +#pod +#pod $range->as_string; +#pod +#pod This returns a string containing the version requirements in the format +#pod described in L. This should only be used for informational +#pod purposes such as error messages and should not be interpreted or used for +#pod comparison (see L instead). +#pod +#pod =cut + +sub as_string { + my ($self) = @_; + + my @parts = @{ $self->as_struct }; + + return $parts[0][1] if @parts == 1 and $parts[0][0] eq '>='; + + return join q{, }, map {; join q{ }, @$_ } @parts; +} + +sub _reject_requirements { + my ($self, $module, $error) = @_; + Carp::croak("illegal requirements for $module: $error") +} + +#pod =method accepts +#pod +#pod my $bool = $range->accepts($version); +#pod +#pod Given a version, this method returns true if the version specification +#pod accepts the provided version. In other words, given: +#pod +#pod '>= 1.00, < 2.00' +#pod +#pod We will accept 1.00 and 1.75 but not 0.50 or 2.00. +#pod +#pod =cut + +sub accepts { + my ($self, $version) = @_; + + return if defined $self->{minimum} and $version < $self->{minimum}; + return if defined $self->{maximum} and $version > $self->{maximum}; + return if defined $self->{exclusions} + and grep { $version == $_ } @{ $self->{exclusions} }; + + return 1; +} + +#pod =method is_simple +#pod +#pod This method returns true if and only if the range is an inclusive minimum +#pod -- that is, if their string expression is just the version number. +#pod +#pod =cut + +sub is_simple { + my ($self) = @_; + # XXX: This is a complete hack, but also entirely correct. + return if $self->as_string =~ /\s/; + + return 1; +} + +package + CPAN::Meta::Requirements::Range::_Exact; + +our @ISA = 'CPAN::Meta::Requirements::Range::_Base'; + +our $VERSION = '2.141'; + +BEGIN { + eval "use version ()"; ## no critic + if ( my $err = $@ ) { + eval "use ExtUtils::MakeMaker::version" or die $err; ## no critic + } +} + +sub _new { bless { version => $_[1] } => $_[0] } + +sub accepts { return $_[0]{version} == $_[1] } + +sub _reject_requirements { + my ($self, $module, $error) = @_; + Carp::croak("illegal requirements for $module: $error") +} + +sub _clone { + (ref $_[0])->_new( version->new( $_[0]{version} ) ) +} + +sub with_exact_version { + my ($self, $version, $module, $bad_version_hook) = @_; + $module //= 'module'; + $version = $self->_version_object($version, $module, $bad_version_hook); + + return $self->_clone if $self->accepts($version); + + $self->_reject_requirements( + $module, + "can't be exactly $version when exact requirement is already $self->{version}", + ); +} + +sub with_minimum { + my ($self, $minimum, $module, $bad_version_hook) = @_; + $module //= 'module'; + $minimum = $self->_version_object( $minimum, $module, $bad_version_hook ); + + return $self->_clone if $self->{version} >= $minimum; + $self->_reject_requirements( + $module, + "minimum $minimum exceeds exact specification $self->{version}", + ); +} + +sub with_maximum { + my ($self, $maximum, $module, $bad_version_hook) = @_; + $module //= 'module'; + $maximum = $self->_version_object( $maximum, $module, $bad_version_hook ); + + return $self->_clone if $self->{version} <= $maximum; + $self->_reject_requirements( + $module, + "maximum $maximum below exact specification $self->{version}", + ); +} + +sub with_exclusion { + my ($self, $exclusion, $module, $bad_version_hook) = @_; + $module //= 'module'; + $exclusion = $self->_version_object( $exclusion, $module, $bad_version_hook ); + + return $self->_clone unless $exclusion == $self->{version}; + $self->_reject_requirements( + $module, + "tried to exclude $exclusion, which is already exactly specified", + ); +} + +sub as_string { return "== $_[0]{version}" } + +sub as_struct { return [ [ '==', "$_[0]{version}" ] ] } + +sub _as_modifiers { return [ with_exact_version => $_[0]{version} ] } + + +1; + +# vim: ts=2 sts=2 sw=2 et: + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +CPAN::Meta::Requirements::Range - a set of version requirements for a CPAN dist + +=head1 VERSION + +version 2.143 + +=head1 SYNOPSIS + + use CPAN::Meta::Requirements::Range; + + my $range = CPAN::Meta::Requirements::Range->with_minimum(1); + + $range = $range->with_maximum('v2.2'); + + my $stringified = $range->as_string; + +=head1 DESCRIPTION + +A CPAN::Meta::Requirements::Range object models a set of version constraints like +those specified in the F or F files in CPAN distributions, +and as defined by L; +It can be built up by adding more and more constraints, and it will reduce them +to the simplest representation. + +Logically impossible constraints will be identified immediately by thrown +exceptions. + +=head1 METHODS + +=head2 with_string_requirement + + $req->with_string_requirement('>= 1.208, <= 2.206'); + $req->with_string_requirement(v1.208); + +This method parses the passed in string and adds the appropriate requirement. +A version can be a Perl "v-string". It understands version ranges as described +in the L. For example: + +=over 4 + +=item 1.3 + +=item >= 1.3 + +=item <= 1.3 + +=item == 1.3 + +=item != 1.3 + +=item > 1.3 + +=item < 1.3 + +=item >= 1.3, != 1.5, <= 2.0 + +A version number without an operator is equivalent to specifying a minimum +(C=>). Extra whitespace is allowed. + +=back + +=head2 with_range + + $range->with_range($other_range) + +This creates a new range object that is a merge two others. + +=head2 with_exact_version + + $range->with_exact_version( $version ); + +This sets the version required to I the given +version. No other version would be considered acceptable. + +This method returns the version range object. + +=head2 with_minimum + + $range->with_minimum( $version ); + +This adds a new minimum version requirement. If the new requirement is +redundant to the existing specification, this has no effect. + +Minimum requirements are inclusive. C<$version> is required, along with any +greater version number. + +This method returns the version range object. + +=head2 with_maximum + + $range->with_maximum( $version ); + +This adds a new maximum version requirement. If the new requirement is +redundant to the existing specification, this has no effect. + +Maximum requirements are inclusive. No version strictly greater than the given +version is allowed. + +This method returns the version range object. + +=head2 with_exclusion + + $range->with_exclusion( $version ); + +This adds a new excluded version. For example, you might use these three +method calls: + + $range->with_minimum( '1.00' ); + $range->with_maximum( '1.82' ); + + $range->with_exclusion( '1.75' ); + +Any version between 1.00 and 1.82 inclusive would be acceptable, except for +1.75. + +This method returns the requirements object. + +=head2 as_struct + + $range->as_struct( $module ); + +This returns a data structure containing the version requirements. This should +not be used for version checks (see L instead). + +=head2 as_string + + $range->as_string; + +This returns a string containing the version requirements in the format +described in L. This should only be used for informational +purposes such as error messages and should not be interpreted or used for +comparison (see L instead). + +=head2 accepts + + my $bool = $range->accepts($version); + +Given a version, this method returns true if the version specification +accepts the provided version. In other words, given: + + '>= 1.00, < 2.00' + +We will accept 1.00 and 1.75 but not 0.50 or 2.00. + +=head2 is_simple + +This method returns true if and only if the range is an inclusive minimum +-- that is, if their string expression is just the version number. + +=head1 AUTHORS + +=over 4 + +=item * + +David Golden + +=item * + +Ricardo Signes + +=back + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2010 by David Golden and Ricardo Signes. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut diff -Nru libcpan-meta-requirements-perl-2.140/lib/CPAN/Meta/Requirements.pm libcpan-meta-requirements-perl-2.143/lib/CPAN/Meta/Requirements.pm --- libcpan-meta-requirements-perl-2.140/lib/CPAN/Meta/Requirements.pm 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/lib/CPAN/Meta/Requirements.pm 2023-06-19 18:51:59.000000000 +0000 @@ -1,10 +1,12 @@ -use 5.006; # keep at v5.6 for CPAN.pm +use v5.10; use strict; use warnings; package CPAN::Meta::Requirements; # ABSTRACT: a set of version requirements for a CPAN dist -our $VERSION = '2.140'; +our $VERSION = '2.143'; + +use CPAN::Meta::Requirements::Range; #pod =head1 SYNOPSIS #pod @@ -24,7 +26,7 @@ #pod #pod A CPAN::Meta::Requirements object models a set of version constraints like #pod those specified in the F or F files in CPAN distributions, -#pod and as defined by L; +#pod and as defined by L. #pod It can be built up by adding more and more constraints, and it will reduce them #pod to the simplest representation. #pod @@ -35,25 +37,6 @@ use Carp (); -# To help ExtUtils::MakeMaker bootstrap CPAN::Meta::Requirements on perls -# before 5.10, we fall back to the EUMM bundled compatibility version module if -# that's the only thing available. This shouldn't ever happen in a normal CPAN -# install of CPAN::Meta::Requirements, as version.pm will be picked up from -# prereqs and be available at runtime. - -BEGIN { - eval "use version ()"; ## no critic - if ( my $err = $@ ) { - eval "use ExtUtils::MakeMaker::version" or die $err; ## no critic - } -} - -# Perl 5.10.0 didn't have "is_qv" in version.pm -*_is_qv = version->can('is_qv') ? sub { $_[0]->is_qv } : sub { exists $_[0]->{qv} }; - -# construct once, reuse many times -my $V0 = version->new(0); - #pod =method new #pod #pod my $req = CPAN::Meta::Requirements->new; @@ -83,82 +66,6 @@ return bless \%self => $class; } -# from version::vpp -sub _find_magic_vstring { - my $value = shift; - my $tvalue = ''; - require B; - my $sv = B::svref_2object(\$value); - my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef; - while ( $magic ) { - if ( $magic->TYPE eq 'V' ) { - $tvalue = $magic->PTR; - $tvalue =~ s/^v?(.+)$/v$1/; - last; - } - else { - $magic = $magic->MOREMAGIC; - } - } - return $tvalue; -} - -# safe if given an unblessed reference -sub _isa_version { - UNIVERSAL::isa( $_[0], 'UNIVERSAL' ) && $_[0]->isa('version') -} - -sub _version_object { - my ($self, $module, $version) = @_; - - my ($vobj, $err); - - if (not defined $version or (!ref($version) && $version eq '0')) { - return $V0; - } - elsif ( ref($version) eq 'version' || ( ref($version) && _isa_version($version) ) ) { - $vobj = $version; - } - else { - # hack around version::vpp not handling <3 character vstring literals - if ( $INC{'version/vpp.pm'} || $INC{'ExtUtils/MakeMaker/version/vpp.pm'} ) { - my $magic = _find_magic_vstring( $version ); - $version = $magic if length $magic; - } - # pad to 3 characters if before 5.8.1 and appears to be a v-string - if ( $] < 5.008001 && $version !~ /\A[0-9]/ && substr($version,0,1) ne 'v' && length($version) < 3 ) { - $version .= "\0" x (3 - length($version)); - } - eval { - local $SIG{__WARN__} = sub { die "Invalid version: $_[0]" }; - # avoid specific segfault on some older version.pm versions - die "Invalid version: $version" if $version eq 'version'; - $vobj = version->new($version); - }; - if ( my $err = $@ ) { - my $hook = $self->{bad_version_hook}; - $vobj = eval { $hook->($version, $module) } - if ref $hook eq 'CODE'; - unless (eval { $vobj->isa("version") }) { - $err =~ s{ at .* line \d+.*$}{}; - die "Can't convert '$version': $err"; - } - } - } - - # ensure no leading '.' - if ( $vobj =~ m{\A\.} ) { - $vobj = version->new("0$vobj"); - } - - # ensure normal v-string form - if ( _is_qv($vobj) ) { - $vobj = version->new($vobj->normal); - } - - return $vobj; -} - #pod =method add_minimum #pod #pod $req->add_minimum( $module => $version ); @@ -219,8 +126,6 @@ my $code = sub { my ($self, $name, $version) = @_; - $version = $self->_version_object( $name, $version ); - $self->__modify_entry_for($name, $method, $version); return $self; @@ -240,20 +145,29 @@ # which preserves the user's choice of "0.00" as the requirement if (not defined $version or "$version" eq '0') { return $self if $self->__entry_for($name); - Carp::confess("can't add new requirements to finalized requirements") + Carp::croak("can't add new requirements to finalized requirements") if $self->is_finalized; $self->{requirements}{ $name } = - CPAN::Meta::Requirements::_Range::Range->with_minimum($V0, $name); + CPAN::Meta::Requirements::Range->with_minimum('0', $name); } else { - $version = $self->_version_object( $name, $version ); - $self->__modify_entry_for($name, 'with_minimum', $version); } return $self; } +#pod =method version_range_for_module +#pod +#pod $req->version_range_for_module( $another_req_object ); +#pod +#pod =cut + +sub version_range_for_module { + my ($self, $module) = @_; + return $self->{requirements}{$module}; +} + #pod =method add_requirements #pod #pod $req->add_requirements( $another_req_object ); @@ -270,11 +184,8 @@ my ($self, $req) = @_; for my $module ($req->required_modules) { - my $modifiers = $req->__entry_for($module)->as_modifiers; - for my $modifier (@$modifiers) { - my ($method, @args) = @$modifier; - $self->$method($module => @args); - }; + my $new_range = $req->version_range_for_module($module); + $self->__modify_entry_for($module, 'with_range', $new_range); } return $self; @@ -300,10 +211,8 @@ sub accepts_module { my ($self, $module, $version) = @_; - $version = $self->_version_object( $module, $version ); - return 1 unless my $range = $self->__entry_for($module); - return $range->_accepts($version); + return $range->accepts($version); } #pod =method clear_requirement @@ -321,7 +230,7 @@ return $self unless $self->__entry_for($module); - Carp::confess("can't clear requirements on finalized requirements") + Carp::croak("can't clear requirements on finalized requirements") if $self->is_finalized; delete $self->{requirements}{ $module }; @@ -400,13 +309,13 @@ my $fin = $self->is_finalized; my $old = $self->__entry_for($name); - Carp::confess("can't add new requirements to finalized requirements") + Carp::croak("can't add new requirements to finalized requirements") if $fin and not $old; - my $new = ($old || 'CPAN::Meta::Requirements::_Range::Range') - ->$method($version, $name); + my $new = ($old || 'CPAN::Meta::Requirements::Range') + ->$method($version, $name, $self->{bad_version_hook}); - Carp::confess("can't modify finalized requirements") + Carp::croak("can't modify finalized requirements") if $fin and $old->as_string ne $new->as_string; $self->{requirements}{ $name } = $new; @@ -423,7 +332,7 @@ my ($self) = @_; for my $module ($self->required_modules) { # XXX: This is a complete hack, but also entirely correct. - return if $self->__entry_for($module)->as_string =~ /\s/; + return if not $self->__entry_for($module)->is_simple; } return 1; @@ -529,43 +438,10 @@ #pod #pod =cut -my %methods_for_op = ( - '==' => [ qw(exact_version) ], - '!=' => [ qw(add_exclusion) ], - '>=' => [ qw(add_minimum) ], - '<=' => [ qw(add_maximum) ], - '>' => [ qw(add_minimum add_exclusion) ], - '<' => [ qw(add_maximum add_exclusion) ], -); - sub add_string_requirement { my ($self, $module, $req) = @_; - unless ( defined $req && length $req ) { - $req = 0; - $self->_blank_carp($module); - } - - my $magic = _find_magic_vstring( $req ); - if (length $magic) { - $self->add_minimum($module => $magic); - return; - } - - my @parts = split qr{\s*,\s*}, $req; - - for my $part (@parts) { - my ($op, $ver) = $part =~ m{\A\s*(==|>=|>|<=|<|!=)\s*(.*)\z}; - - if (! defined $op) { - $self->add_minimum($module => $part); - } else { - Carp::confess("illegal requirement string: $req") - unless my $methods = $methods_for_op{ $op }; - - $self->$_($module => $ver) for @$methods; - } - } + $self->__modify_entry_for($module, 'with_string_requirement', $req); } #pod =method from_string_hash @@ -582,11 +458,6 @@ #pod #pod =cut -sub _blank_carp { - my ($self, $module) = @_; - Carp::carp("Undefined requirement for $module treated as '0'"); -} - sub from_string_hash { my ($class, $hash, $options) = @_; @@ -594,267 +465,12 @@ for my $module (keys %$hash) { my $req = $hash->{$module}; - unless ( defined $req && length $req ) { - $req = 0; - $class->_blank_carp($module); - } $self->add_string_requirement($module, $req); } return $self; } -############################################################## - -{ - package - CPAN::Meta::Requirements::_Range::Exact; - sub _new { bless { version => $_[1] } => $_[0] } - - sub _accepts { return $_[0]{version} == $_[1] } - - sub as_string { return "== $_[0]{version}" } - - sub as_struct { return [ [ '==', "$_[0]{version}" ] ] } - - sub as_modifiers { return [ [ exact_version => $_[0]{version} ] ] } - - sub _reject_requirements { - my ($self, $module, $error) = @_; - Carp::confess("illegal requirements for $module: $error") - } - - sub _clone { - (ref $_[0])->_new( version->new( $_[0]{version} ) ) - } - - sub with_exact_version { - my ($self, $version, $module) = @_; - $module = 'module' unless defined $module; - - return $self->_clone if $self->_accepts($version); - - $self->_reject_requirements( - $module, - "can't be exactly $version when exact requirement is already $self->{version}", - ); - } - - sub with_minimum { - my ($self, $minimum, $module) = @_; - $module = 'module' unless defined $module; - - return $self->_clone if $self->{version} >= $minimum; - $self->_reject_requirements( - $module, - "minimum $minimum exceeds exact specification $self->{version}", - ); - } - - sub with_maximum { - my ($self, $maximum, $module) = @_; - $module = 'module' unless defined $module; - - return $self->_clone if $self->{version} <= $maximum; - $self->_reject_requirements( - $module, - "maximum $maximum below exact specification $self->{version}", - ); - } - - sub with_exclusion { - my ($self, $exclusion, $module) = @_; - $module = 'module' unless defined $module; - - return $self->_clone unless $exclusion == $self->{version}; - $self->_reject_requirements( - $module, - "tried to exclude $exclusion, which is already exactly specified", - ); - } -} - -############################################################## - -{ - package - CPAN::Meta::Requirements::_Range::Range; - - sub _self { ref($_[0]) ? $_[0] : (bless { } => $_[0]) } - - sub _clone { - return (bless { } => $_[0]) unless ref $_[0]; - - my ($s) = @_; - my %guts = ( - (exists $s->{minimum} ? (minimum => version->new($s->{minimum})) : ()), - (exists $s->{maximum} ? (maximum => version->new($s->{maximum})) : ()), - - (exists $s->{exclusions} - ? (exclusions => [ map { version->new($_) } @{ $s->{exclusions} } ]) - : ()), - ); - - bless \%guts => ref($s); - } - - sub as_modifiers { - my ($self) = @_; - my @mods; - push @mods, [ add_minimum => $self->{minimum} ] if exists $self->{minimum}; - push @mods, [ add_maximum => $self->{maximum} ] if exists $self->{maximum}; - push @mods, map {; [ add_exclusion => $_ ] } @{$self->{exclusions} || []}; - return \@mods; - } - - sub as_struct { - my ($self) = @_; - - return 0 if ! keys %$self; - - my @exclusions = @{ $self->{exclusions} || [] }; - - my @parts; - - for my $tuple ( - [ qw( >= > minimum ) ], - [ qw( <= < maximum ) ], - ) { - my ($op, $e_op, $k) = @$tuple; - if (exists $self->{$k}) { - my @new_exclusions = grep { $_ != $self->{ $k } } @exclusions; - if (@new_exclusions == @exclusions) { - push @parts, [ $op, "$self->{ $k }" ]; - } else { - push @parts, [ $e_op, "$self->{ $k }" ]; - @exclusions = @new_exclusions; - } - } - } - - push @parts, map {; [ "!=", "$_" ] } @exclusions; - - return \@parts; - } - - sub as_string { - my ($self) = @_; - - my @parts = @{ $self->as_struct }; - - return $parts[0][1] if @parts == 1 and $parts[0][0] eq '>='; - - return join q{, }, map {; join q{ }, @$_ } @parts; - } - - sub _reject_requirements { - my ($self, $module, $error) = @_; - Carp::confess("illegal requirements for $module: $error") - } - - sub with_exact_version { - my ($self, $version, $module) = @_; - $module = 'module' unless defined $module; - $self = $self->_clone; - - unless ($self->_accepts($version)) { - $self->_reject_requirements( - $module, - "exact specification $version outside of range " . $self->as_string - ); - } - - return CPAN::Meta::Requirements::_Range::Exact->_new($version); - } - - sub _simplify { - my ($self, $module) = @_; - - if (defined $self->{minimum} and defined $self->{maximum}) { - if ($self->{minimum} == $self->{maximum}) { - if (grep { $_ == $self->{minimum} } @{ $self->{exclusions} || [] }) { - $self->_reject_requirements( - $module, - "minimum and maximum are both $self->{minimum}, which is excluded", - ); - } - - return CPAN::Meta::Requirements::_Range::Exact->_new($self->{minimum}) - } - - if ($self->{minimum} > $self->{maximum}) { - $self->_reject_requirements( - $module, - "minimum $self->{minimum} exceeds maximum $self->{maximum}", - ); - } - } - - # eliminate irrelevant exclusions - if ($self->{exclusions}) { - my %seen; - @{ $self->{exclusions} } = grep { - (! defined $self->{minimum} or $_ >= $self->{minimum}) - and - (! defined $self->{maximum} or $_ <= $self->{maximum}) - and - ! $seen{$_}++ - } @{ $self->{exclusions} }; - } - - return $self; - } - - sub with_minimum { - my ($self, $minimum, $module) = @_; - $module = 'module' unless defined $module; - $self = $self->_clone; - - if (defined (my $old_min = $self->{minimum})) { - $self->{minimum} = (sort { $b cmp $a } ($minimum, $old_min))[0]; - } else { - $self->{minimum} = $minimum; - } - - return $self->_simplify($module); - } - - sub with_maximum { - my ($self, $maximum, $module) = @_; - $module = 'module' unless defined $module; - $self = $self->_clone; - - if (defined (my $old_max = $self->{maximum})) { - $self->{maximum} = (sort { $a cmp $b } ($maximum, $old_max))[0]; - } else { - $self->{maximum} = $maximum; - } - - return $self->_simplify($module); - } - - sub with_exclusion { - my ($self, $exclusion, $module) = @_; - $module = 'module' unless defined $module; - $self = $self->_clone; - - push @{ $self->{exclusions} ||= [] }, $exclusion; - - return $self->_simplify($module); - } - - sub _accepts { - my ($self, $version) = @_; - - return if defined $self->{minimum} and $version < $self->{minimum}; - return if defined $self->{maximum} and $version > $self->{maximum}; - return if defined $self->{exclusions} - and grep { $version == $_ } @{ $self->{exclusions} }; - - return 1; - } -} - 1; # vim: ts=2 sts=2 sw=2 et: @@ -870,7 +486,7 @@ =head1 VERSION -version 2.140 +version 2.143 =head1 SYNOPSIS @@ -890,7 +506,7 @@ A CPAN::Meta::Requirements object models a set of version constraints like those specified in the F or F files in CPAN distributions, -and as defined by L; +and as defined by L. It can be built up by adding more and more constraints, and it will reduce them to the simplest representation. @@ -966,6 +582,10 @@ This method returns the requirements object. +=head2 version_range_for_module + + $req->version_range_for_module( $another_req_object ); + =head2 add_requirements $req->add_requirements( $another_req_object ); @@ -1127,7 +747,7 @@ you can supply a hash-reference of options, exactly as with the L method. -=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan +=for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT @@ -1162,7 +782,7 @@ =head1 CONTRIBUTORS -=for stopwords Ed J Karen Etheridge Leon Timmermans robario +=for stopwords Ed J Graham Knop Karen Etheridge Leon Timmermans Paul Howarth Ricardo Signes robario Tatsuhiko Miyagawa =over 4 @@ -1172,6 +792,10 @@ =item * +Graham Knop + +=item * + Karen Etheridge =item * @@ -1180,8 +804,24 @@ =item * +Paul Howarth + +=item * + +Ricardo Signes + +=item * + robario +=item * + +Tatsuhiko Miyagawa + +=item * + +Tatsuhiko Miyagawa + =back =head1 COPYRIGHT AND LICENSE diff -Nru libcpan-meta-requirements-perl-2.140/LICENSE libcpan-meta-requirements-perl-2.143/LICENSE --- libcpan-meta-requirements-perl-2.140/LICENSE 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/LICENSE 2023-06-19 18:51:59.000000000 +0000 @@ -292,21 +292,21 @@ - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through - textual modification. + textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright - Holder. + Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. + the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) + computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they - received it. + received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you @@ -373,7 +373,7 @@ 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End diff -Nru libcpan-meta-requirements-perl-2.140/Makefile.PL libcpan-meta-requirements-perl-2.143/Makefile.PL --- libcpan-meta-requirements-perl-2.140/Makefile.PL 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/Makefile.PL 2023-06-19 18:51:59.000000000 +0000 @@ -1,8 +1,8 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.042. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030. use strict; use warnings; -use 5.006; +use 5.010000; use ExtUtils::MakeMaker 6.17; @@ -14,7 +14,7 @@ }, "DISTNAME" => "CPAN-Meta-Requirements", "LICENSE" => "perl", - "MIN_PERL_VERSION" => "5.006", + "MIN_PERL_VERSION" => "5.010000", "NAME" => "CPAN::Meta::Requirements", "PREREQ_PM" => { "B" => 0, @@ -29,7 +29,7 @@ "Test::More" => "0.88", "version" => "0.88" }, - "VERSION" => "2.140", + "VERSION" => "2.143", "test" => { "TESTS" => "t/*.t" } diff -Nru libcpan-meta-requirements-perl-2.140/MANIFEST libcpan-meta-requirements-perl-2.143/MANIFEST --- libcpan-meta-requirements-perl-2.140/MANIFEST 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/MANIFEST 2023-06-19 18:51:59.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.042. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030. CONTRIBUTING.mkdn Changes LICENSE @@ -10,6 +10,7 @@ cpanfile dist.ini lib/CPAN/Meta/Requirements.pm +lib/CPAN/Meta/Requirements/Range.pm perlcritic.rc t/00-report-prereqs.dd t/00-report-prereqs.t @@ -23,10 +24,10 @@ t/version-cleanup.t xt/author/00-compile.t xt/author/critic.t +xt/author/distmeta.t +xt/author/minimum-version.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t +xt/author/portability.t xt/author/test-version.t -xt/release/distmeta.t -xt/release/minimum-version.t -xt/release/portability.t diff -Nru libcpan-meta-requirements-perl-2.140/META.json libcpan-meta-requirements-perl-2.143/META.json --- libcpan-meta-requirements-perl-2.140/META.json 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/META.json 2023-06-19 18:51:59.000000000 +0000 @@ -5,7 +5,7 @@ "Ricardo Signes " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.042, CPAN::Meta::Converter version 2.150001", + "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -29,7 +29,7 @@ "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.17", - "perl" : "5.006" + "perl" : "v5.10.0" } }, "develop" : { @@ -87,28 +87,30 @@ "Dist::Zilla::Plugin::Test::Version" : "0", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", - "English" : "0", "File::Spec" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", + "Pod::Weaver::PluginBundle::DAGOLDEN" : "0", "Pod::Wordlist" : "0", "Software::License::Perl_5" : "0", "Test::CPAN::Meta" : "0", + "Test::MinimumVersion" : "0", "Test::More" : "0", + "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", + "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", - "Test::Version" : "1", - "blib" : "1.01" + "Test::Version" : "1" } }, "runtime" : { "requires" : { "B" : "0", "Carp" : "0", - "perl" : "5.006", + "perl" : "v5.10.0", "strict" : "0", "version" : "0.88", "warnings" : "0" @@ -122,7 +124,7 @@ "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0.88", - "perl" : "5.006", + "perl" : "v5.10.0", "version" : "0.88" } } @@ -130,7 +132,11 @@ "provides" : { "CPAN::Meta::Requirements" : { "file" : "lib/CPAN/Meta/Requirements.pm", - "version" : "2.140" + "version" : "2.143" + }, + "CPAN::Meta::Requirements::Range" : { + "file" : "lib/CPAN/Meta/Requirements/Range.pm", + "version" : "2.143" } }, "release_status" : "stable", @@ -145,13 +151,21 @@ "web" : "https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements" } }, - "version" : "2.140", + "version" : "2.143", "x_authority" : "cpan:DAGOLDEN", "x_contributors" : [ "Ed J ", + "Graham Knop ", "Karen Etheridge ", "Leon Timmermans ", - "robario " - ] + "Paul Howarth ", + "Ricardo Signes ", + "robario ", + "Tatsuhiko Miyagawa ", + "Tatsuhiko Miyagawa " + ], + "x_generated_by_perl" : "v5.37.10", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.36", + "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } diff -Nru libcpan-meta-requirements-perl-2.140/META.yml libcpan-meta-requirements-perl-2.143/META.yml --- libcpan-meta-requirements-perl-2.140/META.yml 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/META.yml 2023-06-19 18:51:59.000000000 +0000 @@ -7,13 +7,13 @@ ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0.88' - perl: '5.006' + perl: v5.10.0 version: '0.88' configure_requires: ExtUtils::MakeMaker: '6.17' - perl: '5.006' + perl: v5.10.0 dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.042, CPAN::Meta::Converter version 2.150001' +generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -30,11 +30,14 @@ provides: CPAN::Meta::Requirements: file: lib/CPAN/Meta/Requirements.pm - version: '2.140' + version: '2.143' + CPAN::Meta::Requirements::Range: + file: lib/CPAN/Meta/Requirements/Range.pm + version: '2.143' requires: B: '0' Carp: '0' - perl: '5.006' + perl: v5.10.0 strict: '0' version: '0.88' warnings: '0' @@ -42,10 +45,18 @@ bugtracker: https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/issues homepage: https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements repository: https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements.git -version: '2.140' +version: '2.143' x_authority: cpan:DAGOLDEN x_contributors: - 'Ed J ' + - 'Graham Knop ' - 'Karen Etheridge ' - 'Leon Timmermans ' + - 'Paul Howarth ' + - 'Ricardo Signes ' - 'robario ' + - 'Tatsuhiko Miyagawa ' + - 'Tatsuhiko Miyagawa ' +x_generated_by_perl: v5.37.10 +x_serialization_backend: 'YAML::Tiny version 1.73' +x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' diff -Nru libcpan-meta-requirements-perl-2.140/README libcpan-meta-requirements-perl-2.143/README --- libcpan-meta-requirements-perl-2.140/README 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/README 2023-06-19 18:51:59.000000000 +0000 @@ -2,7 +2,7 @@ CPAN::Meta::Requirements - a set of version requirements for a CPAN dist VERSION - version 2.140 + version 2.143 SYNOPSIS use CPAN::Meta::Requirements; @@ -20,7 +20,7 @@ DESCRIPTION A CPAN::Meta::Requirements object models a set of version constraints like those specified in the META.yml or META.json files in CPAN - distributions, and as defined by CPAN::Meta::Spec; It can be built up by + distributions, and as defined by CPAN::Meta::Spec. It can be built up by adding more and more constraints, and it will reduce them to the simplest representation. @@ -87,6 +87,9 @@ This method returns the requirements object. + version_range_for_module + $req->version_range_for_module( $another_req_object ); + add_requirements $req->add_requirements( $another_req_object ); @@ -246,12 +249,22 @@ CONTRIBUTORS * Ed J + * Graham Knop + * Karen Etheridge * Leon Timmermans + * Paul Howarth + + * Ricardo Signes + * robario + * Tatsuhiko Miyagawa + + * Tatsuhiko Miyagawa + COPYRIGHT AND LICENSE This software is copyright (c) 2010 by David Golden and Ricardo Signes. diff -Nru libcpan-meta-requirements-perl-2.140/t/00-report-prereqs.dd libcpan-meta-requirements-perl-2.143/t/00-report-prereqs.dd --- libcpan-meta-requirements-perl-2.140/t/00-report-prereqs.dd 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/00-report-prereqs.dd 2023-06-19 18:51:59.000000000 +0000 @@ -2,7 +2,7 @@ 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.17', - 'perl' => '5.006' + 'perl' => 'v5.10.0' } }, 'develop' => { @@ -60,28 +60,30 @@ 'Dist::Zilla::Plugin::Test::Version' => '0', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', - 'English' => '0', 'File::Spec' => '0', 'File::Temp' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', + 'Pod::Weaver::PluginBundle::DAGOLDEN' => '0', 'Pod::Wordlist' => '0', 'Software::License::Perl_5' => '0', 'Test::CPAN::Meta' => '0', + 'Test::MinimumVersion' => '0', 'Test::More' => '0', + 'Test::Perl::Critic' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', + 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', - 'Test::Version' => '1', - 'blib' => '1.01' + 'Test::Version' => '1' } }, 'runtime' => { 'requires' => { 'B' => '0', 'Carp' => '0', - 'perl' => '5.006', + 'perl' => 'v5.10.0', 'strict' => '0', 'version' => '0.88', 'warnings' => '0' @@ -95,7 +97,7 @@ 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0.88', - 'perl' => '5.006', + 'perl' => 'v5.10.0', 'version' => '0.88' } } diff -Nru libcpan-meta-requirements-perl-2.140/t/00-report-prereqs.t libcpan-meta-requirements-perl-2.143/t/00-report-prereqs.t --- libcpan-meta-requirements-perl-2.140/t/00-report-prereqs.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/00-report-prereqs.t 2023-06-19 18:51:59.000000000 +0000 @@ -3,7 +3,7 @@ use strict; use warnings; -# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021 +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; @@ -68,7 +68,7 @@ ); # Add static prereqs to the included modules list -my $static_prereqs = do 't/00-report-prereqs.dd'; +my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( @@ -78,12 +78,14 @@ # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; -if ( $source && $HAS_CPAN_META ) { - if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { - $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); - } +my $cpan_meta_error; +if ( $source && $HAS_CPAN_META + && (my $meta = eval { CPAN::Meta->load_file($source) } ) +) { + $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { + $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } @@ -107,20 +109,24 @@ my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { - next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; - my $file = $mod; - $file =~ s{::}{/}g; - $file .= ".pm"; - my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; - my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; + if ($mod eq 'perl') { + push @reports, ['perl', $want, $]]; + next; + } + my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; + my $file = $mod; + $file =~ s{::}{/}g; + $file .= ".pm"; + my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; + if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; @@ -169,15 +175,23 @@ diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } +if ( $cpan_meta_error || @dep_errors ) { + diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; +} + +if ( $cpan_meta_error ) { + my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; + diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; +} + if ( @dep_errors ) { diag join("\n", - "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", - "The following REQUIRED prerequisites were not satisfied:\n", + "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } -pass; +pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: diff -Nru libcpan-meta-requirements-perl-2.140/t/accepts.t libcpan-meta-requirements-perl-2.143/t/accepts.t --- libcpan-meta-requirements-perl-2.140/t/accepts.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/accepts.t 2023-06-19 18:51:59.000000000 +0000 @@ -36,4 +36,35 @@ ok(! $req->accepts_module(Foo => 1), "need !1, got 1"); } +{ + my $req = CPAN::Meta::Requirements::Range->with_minimum(1); + + ok( $req->accepts(1), "need 1, got 1"); + ok(! $req->accepts(0), "need 0, got 1"); +} + +{ + my $req = CPAN::Meta::Requirements::Range->with_minimum(0); + + ok( $req->accepts(1), "need 0, got 1"); + ok( $req->accepts(undef), "need 0, got undef"); + ok( $req->accepts("v0"), "need 0, got 'v0'"); + ok( $req->accepts(v1.2.3), "need 0, got v1.2.3"); + ok( $req->accepts("v1.2.3"), "need 0, got 'v1.2.3'"); +} + +{ + my $req = CPAN::Meta::Requirements::Range->with_maximum(1); + + ok( $req->accepts(1), "need <=1, got 1"); + ok(! $req->accepts(2), "need <=1, got 2"); +} + +{ + my $req = CPAN::Meta::Requirements::Range->with_exclusion(1); + + ok( $req->accepts(0), "need !1, got 0"); + ok(! $req->accepts(1), "need !1, got 1"); +} + done_testing; diff -Nru libcpan-meta-requirements-perl-2.140/t/from-hash.t libcpan-meta-requirements-perl-2.143/t/from-hash.t --- libcpan-meta-requirements-perl-2.140/t/from-hash.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/from-hash.t 2023-06-19 18:51:59.000000000 +0000 @@ -2,6 +2,7 @@ use warnings; use CPAN::Meta::Requirements; +use CPAN::Meta::Requirements::Range; use Test::More 0.88; @@ -19,6 +20,11 @@ } } +for my $string (10, '>= 2, <= 9, != 7') { + my $range = CPAN::Meta::Requirements::Range->with_string_requirement($string); + is ($range->as_string, $string, "'$string' roundtrips"); +} + { my $string_hash = { Left => 10, @@ -50,6 +56,17 @@ } { + my $warning; + local $SIG{__WARN__} = sub { $warning = join("\n",@_) }; + + my $range = CPAN::Meta::Requirements::Range->with_string_requirement(undef); + like ($warning, qr/Undefined requirement.*treated as '0'/, "undef requirement warns"); + $range->with_string_requirement(''); + like ($warning, qr/Undefined requirement.*treated as '0'/, "'' requirement warns"); + +} + +{ my $undef_hash = { Undef => undef }; my $z_hash = { ZeroLength => '' }; diff -Nru libcpan-meta-requirements-perl-2.140/t/merge.t libcpan-meta-requirements-perl-2.143/t/merge.t --- libcpan-meta-requirements-perl-2.140/t/merge.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/merge.t 2023-06-19 18:51:59.000000000 +0000 @@ -2,6 +2,7 @@ use warnings; use CPAN::Meta::Requirements; +use CPAN::Meta::Requirements::Range; use Test::More 0.88; @@ -20,6 +21,14 @@ } { + my $range = CPAN::Meta::Requirements::Range->with_minimum(2); + $range = $range->with_maximum(9); + $range = $range->with_exclusion(7); + is($range->as_string, '>= 2, <= 9, != 7'); +} + + +{ my $req_1 = CPAN::Meta::Requirements->new; $req_1->add_minimum(Left => 10); $req_1->add_minimum(Shared => 2); diff -Nru libcpan-meta-requirements-perl-2.140/t/strings.t libcpan-meta-requirements-perl-2.143/t/strings.t --- libcpan-meta-requirements-perl-2.140/t/strings.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/t/strings.t 2023-06-19 18:51:59.000000000 +0000 @@ -18,6 +18,54 @@ use CPAN::Meta::Requirements; + +my $base = 'CPAN::Meta::Requirements::Range'; + +# Test == +my $range = $base->with_string_requirement('== 1.3'); +ok($range->accepts('1.3'), 'exact version (==)'); +ok(!$range->accepts('1.2'), 'lower version (==)'); +ok(!$range->accepts('1.4'), 'higher version (==)'); + +# Test != +$range = $base->with_string_requirement('!= 1.3'); +ok(!$range->accepts('1.3'), 'exact version (!=)'); +ok($range->accepts('1.2'), 'lower version (!=)'); +ok($range->accepts('1.4'), 'higher version (!=)'); + +# Test >= +$range = $base->with_string_requirement('>= 1.3'); +ok($range->accepts('1.3'), 'exact version (>=)'); +ok(!$range->accepts('1.2'), 'lower version (>=)'); +ok($range->accepts('1.4'), 'higher version (>=)'); + +# Test <= +$range = $range = $base->with_string_requirement('<= 1.3'); +ok($range->accepts('1.3'), 'exact version (<=)'); +ok($range->accepts('1.2'), 'lower version (<=)'); +ok(!$range->accepts('1.4'), 'higher version (<=)'); + +# Test "" +$range = $base->with_string_requirement('1.3'); +ok($range->accepts('1.3'), 'exact version ("")'); +ok(!$range->accepts('1.2'), 'lower version ("")'); +ok($range->accepts('1.4'), 'higher version ("")'); + +# Test multiple requirements +$range = $base->with_string_requirement('>= 1.3, <= 2.0, != 1.6'); +ok($range->accepts('1.5'), 'middle version (>=, <=, !)'); +ok(!$range->accepts('1.2'), 'lower version (>=, <=, !)'); +ok(!$range->accepts('2.1'), 'higher version (>=, <=, !)'); +ok(!$range->accepts('1.6'), 'excluded version (>=, <=, !)'); + +# Test multiple requirements with implicit minimum +$range = $base->with_string_requirement('0.90, != 0.91'); +ok(!$range->accepts('0.88'), 'lower version ("", !)'); +ok($range->accepts('0.90'), 'exact version ("", !)'); +ok($range->accepts('0.901'), 'middle version ("", !)'); +ok(!$range->accepts('0.91'), 'excluded version ("", !)'); +ok($range->accepts('0.92'), 'higher version ("", !)'); + my $req = CPAN::Meta::Requirements->new; # Test == @@ -45,10 +93,10 @@ ok(!$req->accepts_module('Foo::Graz' => '1.4'), 'higher version (<=)'); # Test "" -$req->add_string_requirement('Foo::Blurb', '>= 1.3'); -ok($req->accepts_module('Foo::Blurb' => '1.3'), 'exact version (>=)'); -ok(!$req->accepts_module('Foo::Blurb' => '1.2'), 'lower version (>=)'); -ok($req->accepts_module('Foo::Blurb' => '1.4'), 'higher version (>=)'); +$req->add_string_requirement('Foo::Blurb', '1.3'); +ok($req->accepts_module('Foo::Blurb' => '1.3'), 'exact version ("")'); +ok(!$req->accepts_module('Foo::Blurb' => '1.2'), 'lower version ("")'); +ok($req->accepts_module('Foo::Blurb' => '1.4'), 'higher version ("")'); # Test multiple requirements $req->add_string_requirement('A::Tribe::Called', '>= 1.3, <= 2.0, != 1.6'); @@ -57,6 +105,21 @@ ok(!$req->accepts_module('A::Tribe::Called' => '2.1'), 'higher version (>=, <=, !)'); ok(!$req->accepts_module('A::Tribe::Called' => '1.6'), 'excluded version (>=, <=, !)'); +# Test multiple requirements with implicit minimum +{ + my $req = CPAN::Meta::Requirements->new; + + $req->add_string_requirement('Foo::MyModule', '0.90, != 0.91'); + + is_deeply( + $req->as_string_hash, + { + 'Foo::MyModule' => '>= 0.90, != 0.91' + }, + "multiple requirements with implicit minimum", + ); +} + # Test precision { my $req = CPAN::Meta::Requirements->new; diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/00-compile.t libcpan-meta-requirements-perl-2.143/xt/author/00-compile.t --- libcpan-meta-requirements-perl-2.140/xt/author/00-compile.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/00-compile.t 2023-06-19 18:51:59.000000000 +0000 @@ -2,14 +2,15 @@ use strict; use warnings; -# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; -plan tests => 2; +plan tests => 3; my @module_files = ( - 'CPAN/Meta/Requirements.pm' + 'CPAN/Meta/Requirements.pm', + 'CPAN/Meta/Requirements/Range.pm' ); @@ -19,7 +20,9 @@ local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); -my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; +my @switches = ( + -d 'blib' ? '-Mblib' : '-Ilib', +); use File::Spec; use IPC::Open3; @@ -33,14 +36,18 @@ # see L my $stderr = IO::Handle->new; - my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); + diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } + $^X, @switches, '-e', "require q[$lib]")) + if $ENV{PERL_COMPILE_TEST_DEBUG}; + + my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ - and not eval { require blib; blib->VERSION('1.01') }; + and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/critic.t libcpan-meta-requirements-perl-2.143/xt/author/critic.t --- libcpan-meta-requirements-perl-2.140/xt/author/critic.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/critic.t 2023-06-19 18:51:59.000000000 +0000 @@ -3,10 +3,5 @@ use strict; use warnings; -use Test::More; -use English qw(-no_match_vars); - -eval "use Test::Perl::Critic"; -plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; -Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; +use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/distmeta.t libcpan-meta-requirements-perl-2.143/xt/author/distmeta.t --- libcpan-meta-requirements-perl-2.140/xt/author/distmeta.t 1970-01-01 00:00:00.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/distmeta.t 2023-06-19 18:51:59.000000000 +0000 @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. +use strict; +use warnings; +use Test::CPAN::Meta; + +meta_yaml_ok(); diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/minimum-version.t libcpan-meta-requirements-perl-2.143/xt/author/minimum-version.t --- libcpan-meta-requirements-perl-2.140/xt/author/minimum-version.t 1970-01-01 00:00:00.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/minimum-version.t 2023-06-19 18:51:59.000000000 +0000 @@ -0,0 +1,6 @@ +use strict; +use warnings; + +use Test::More; +use Test::MinimumVersion; +all_minimum_version_ok( qq{5.010} ); diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/pod-coverage.t libcpan-meta-requirements-perl-2.143/xt/author/pod-coverage.t --- libcpan-meta-requirements-perl-2.140/xt/author/pod-coverage.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/pod-coverage.t 2023-06-19 18:51:59.000000000 +0000 @@ -1,6 +1,7 @@ #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. - +use strict; +use warnings; use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/pod-spell.t libcpan-meta-requirements-perl-2.143/xt/author/pod-spell.t --- libcpan-meta-requirements-perl-2.140/xt/author/pod-spell.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/pod-spell.t 2023-06-19 18:51:59.000000000 +0000 @@ -2,34 +2,44 @@ use warnings; use Test::More; -# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007000 +# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); -all_pod_files_spelling_ok( qw( bin lib ) ); +all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ -invocant -dist +CPAN David +Ed +Etheridge Golden -dagolden +Graham +Howarth +Karen +Knop +Leon +Meta +Miyagawa +Paul +Range +Requirements Ricardo Signes -rjbs +Tatsuhiko +Timmermans and -Ed -mohawk2 -Karen -Etheridge +dagolden +dist ether -Leon -Timmermans fawaka +haarg +invocant +lib +miyagawa +mohawk2 +paul +rjbs robario webmaster -lib -CPAN -Meta -Requirements diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/portability.t libcpan-meta-requirements-perl-2.143/xt/author/portability.t --- libcpan-meta-requirements-perl-2.140/xt/author/portability.t 1970-01-01 00:00:00.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/portability.t 2023-06-19 18:51:59.000000000 +0000 @@ -0,0 +1,8 @@ +use strict; +use warnings; + +use Test::More; + +use Test::Portability::Files; +options(test_one_dot => 0); +run_tests(); diff -Nru libcpan-meta-requirements-perl-2.140/xt/author/test-version.t libcpan-meta-requirements-perl-2.143/xt/author/test-version.t --- libcpan-meta-requirements-perl-2.140/xt/author/test-version.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/author/test-version.t 2023-06-19 18:51:59.000000000 +0000 @@ -2,7 +2,7 @@ use warnings; use Test::More; -# generated by Dist::Zilla::Plugin::Test::Version 1.05 +# generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); @@ -17,7 +17,6 @@ push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); - Test::Version->import(@imports); version_all_ok; diff -Nru libcpan-meta-requirements-perl-2.140/xt/release/distmeta.t libcpan-meta-requirements-perl-2.143/xt/release/distmeta.t --- libcpan-meta-requirements-perl-2.140/xt/release/distmeta.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/release/distmeta.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!perl -# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. - -use Test::CPAN::Meta; - -meta_yaml_ok(); diff -Nru libcpan-meta-requirements-perl-2.140/xt/release/minimum-version.t libcpan-meta-requirements-perl-2.143/xt/release/minimum-version.t --- libcpan-meta-requirements-perl-2.140/xt/release/minimum-version.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/release/minimum-version.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!perl - -use Test::More; - -eval "use Test::MinimumVersion"; -plan skip_all => "Test::MinimumVersion required for testing minimum versions" - if $@; -all_minimum_version_ok( qq{5.006} ); diff -Nru libcpan-meta-requirements-perl-2.140/xt/release/portability.t libcpan-meta-requirements-perl-2.143/xt/release/portability.t --- libcpan-meta-requirements-perl-2.140/xt/release/portability.t 2015-12-12 21:17:22.000000000 +0000 +++ libcpan-meta-requirements-perl-2.143/xt/release/portability.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More; - -eval 'use Test::Portability::Files'; -plan skip_all => 'Test::Portability::Files required for testing portability' - if $@; -options(test_one_dot => 0); -run_tests();