Update to 2.143 (rhbz#2216187)
- New upstream release 2.143 - Fix regression with implicit minimum value and multiple requirements (GH#38) - Don't package perlcritic.rc
This commit is contained in:
parent
10e02f4734
commit
9386e91cd6
@ -1,79 +0,0 @@
|
||||
--- lib/CPAN/Meta/Requirements/Range.pm
|
||||
+++ lib/CPAN/Meta/Requirements/Range.pm
|
||||
@@ -193,7 +193,7 @@ sub with_string_requirement {
|
||||
my ($op, $ver) = $part =~ m{\A\s*(==|>=|>|<=|<|!=)\s*(.*)\z};
|
||||
|
||||
if (! defined $op) {
|
||||
- return $self->with_minimum($part, $module, $bad_version_hook);
|
||||
+ $self = $self->with_minimum($part, $module, $bad_version_hook);
|
||||
} else {
|
||||
Carp::croak("illegal requirement string: $req")
|
||||
unless my $methods = $methods_for_op{ $op };
|
||||
--- t/strings.t
|
||||
+++ t/strings.t
|
||||
@@ -46,10 +46,10 @@ ok($range->accepts('1.2'), 'lower versio
|
||||
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 (>=)');
|
||||
+$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');
|
||||
@@ -58,6 +58,13 @@ ok(!$range->accepts('1.2'), 'lower versi
|
||||
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;
|
||||
|
||||
@@ -86,10 +93,10 @@ ok($req->accepts_module('Foo::Graz' => '
|
||||
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');
|
||||
@@ -98,6 +105,21 @@ ok(!$req->accepts_module('A::Tribe::Call
|
||||
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;
|
||||
@ -2,13 +2,12 @@
|
||||
%bcond_without perl_CPAN_Meta_Requirements_enables_optional_test
|
||||
|
||||
Name: perl-CPAN-Meta-Requirements
|
||||
Version: 2.142
|
||||
Release: 2%{?dist}
|
||||
Version: 2.143
|
||||
Release: 1%{?dist}
|
||||
Summary: Set of version requirements for a CPAN dist
|
||||
License: GPL-1.0-or-later OR Artistic-1.0-Perl
|
||||
URL: https://metacpan.org/release/CPAN-Meta-Requirements
|
||||
Source0: https://cpan.metacpan.org/modules/by-module/CPAN/CPAN-Meta-Requirements-%{version}.tar.gz
|
||||
Patch0: CPAN-Meta-Requirements-2.142-regression.patch
|
||||
BuildArch: noarch
|
||||
# Build
|
||||
BuildRequires: coreutils
|
||||
@ -75,10 +74,6 @@ exceptions.
|
||||
%prep
|
||||
%setup -q -n CPAN-Meta-Requirements-%{version}
|
||||
|
||||
# Fix regression with implicit minimum value and multiple requirements
|
||||
# https://github.com/Perl-Toolchain-Gang/CPAN-Meta-Requirements/pull/38
|
||||
%patch -P 0
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor UNINST=0
|
||||
make %{?_smp_mflags}
|
||||
@ -96,12 +91,17 @@ LANG=en_US make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc Changes CONTRIBUTING.mkdn perlcritic.rc README
|
||||
%doc Changes CONTRIBUTING.mkdn README
|
||||
%{perl_vendorlib}/CPAN/
|
||||
%{_mandir}/man3/CPAN::Meta::Requirements.3*
|
||||
%{_mandir}/man3/CPAN::Meta::Requirements::Range.3*
|
||||
|
||||
%changelog
|
||||
* Tue Jun 20 2023 Paul Howarth <paul@city-fan.org> - 2.143-1
|
||||
- Update to 2.143 (rhbz#2216187)
|
||||
- Fix regression with implicit minimum value and multiple requirements (GH#38)
|
||||
- Don't package perlcritic.rc
|
||||
|
||||
* Wed May 31 2023 Paul Howarth <paul@city-fan.org> - 2.142-2
|
||||
- Fix regression with multiple version numbers
|
||||
(rhbz#2208279, GH#38)
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (CPAN-Meta-Requirements-2.142.tar.gz) = b4d964e32120c17eb6cfc4a2c6d403d52212462d5ec36e1da33bb0c05dff312113f2ac1036cee0425abc1b47b65c19d837e523d03010c70c4c42cf6985689c9d
|
||||
SHA512 (CPAN-Meta-Requirements-2.143.tar.gz) = 01283e54753678bbc731c254f84b989a104a7228faf8a6bc33561b1846d2c410e1ec9219b7ebc073bd41b7e025b22fd96893a6f83f3bf2b07e1eb5766a76833c
|
||||
|
||||
Loading…
Reference in New Issue
Block a user