From fc389466621b1b776cddb35b3c548a78bac62183 Mon Sep 17 00:00:00 2001 From: mgb01105731 Date: Tue, 7 Feb 2023 17:43:45 +0800 Subject: [PATCH] remove versioned MODULE_COMPAT_ requires --- Carp-1.50-Upgrade-to-1.52.patch | 187 ++++++++++++++++++++++++++++++++ perl-Carp.spec | 18 ++- 2 files changed, 199 insertions(+), 6 deletions(-) create mode 100644 Carp-1.50-Upgrade-to-1.52.patch diff --git a/Carp-1.50-Upgrade-to-1.52.patch b/Carp-1.50-Upgrade-to-1.52.patch new file mode 100644 index 0000000..a2a5c3f --- /dev/null +++ b/Carp-1.50-Upgrade-to-1.52.patch @@ -0,0 +1,187 @@ +From a91baa4c8cb395568f4c55199e47ce4807e42bd2 Mon Sep 17 00:00:00 2001 +From: Jitka Plesnikova +Date: Wed, 5 May 2021 13:42:36 +0200 +Subject: [PATCH] Upgrade to 1.52 + +--- + lib/Carp.pm | 12 ++++++------ + lib/Carp/Heavy.pm | 2 +- + t/Carp.t | 6 ++++-- + t/Carp_overloadless.t | 6 ++++-- + t/broken_can.t | 5 ++++- + t/broken_univ_can.t | 12 +++++++++--- + t/vivify_stash.t | 6 +++++- + 7 files changed, 33 insertions(+), 16 deletions(-) + +diff --git a/lib/Carp.pm b/lib/Carp.pm +index 109b7fe..df563d0 100644 +--- a/lib/Carp.pm ++++ b/lib/Carp.pm +@@ -211,7 +211,7 @@ BEGIN { + } + + +-our $VERSION = '1.50'; ++our $VERSION = '1.52'; + $VERSION =~ tr/_//d; + + our $MaxEvalLen = 0; +@@ -284,7 +284,7 @@ sub shortmess { + my $cgc = _cgc(); + + # Icky backwards compatibility wrapper. :-( +- local @CARP_NOT = $cgc ? $cgc->() : caller(); ++ local @CARP_NOT = scalar( $cgc ? $cgc->() : caller() ); + shortmess_heavy(@_); + } + +@@ -944,10 +944,10 @@ This variable sets a general argument formatter to display references. + Plain scalars and objects that implement C will not go through + this formatter. Calling C from within this function is not supported. + +-local $Carp::RefArgFormatter = sub { +- require Data::Dumper; +- Data::Dumper::Dump($_[0]); # not necessarily safe +-}; ++ local $Carp::RefArgFormatter = sub { ++ require Data::Dumper; ++ Data::Dumper->Dump($_[0]); # not necessarily safe ++ }; + + =head2 @CARP_NOT + +diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm +index a9b803c..fdb3e52 100644 +--- a/lib/Carp/Heavy.pm ++++ b/lib/Carp/Heavy.pm +@@ -2,7 +2,7 @@ package Carp::Heavy; + + use Carp (); + +-our $VERSION = '1.50'; ++our $VERSION = '1.52'; + $VERSION =~ tr/_//d; + + # Carp::Heavy was merged into Carp in version 1.12. Any mismatched versions +diff --git a/t/Carp.t b/t/Carp.t +index b1e399d..02c047e 100644 +--- a/t/Carp.t ++++ b/t/Carp.t +@@ -1,5 +1,6 @@ ++use strict; + use warnings; +-no warnings "once"; ++ + use Config; + + use IPC::Open3 1.0103 qw(open3); +@@ -353,6 +354,7 @@ for my $bodge_job ( 2, 1, 0 ) { SKIP: { + print "# required B\n"; + } + my $accum = ''; ++ no warnings 'once'; + local *CORE::GLOBAL::caller = sub { + local *__ANON__ = "fakecaller"; + my @c = CORE::caller(@_); +@@ -480,7 +482,7 @@ SKIP: + ); + + package Foo::No::Autovivify; +- $CARP_NOT = 1; ++ our $CARP_NOT = 1; + eval { Carp::croak(1) }; + ::ok( + !defined *{$Foo::No::Autovivify::{CARP_NOT}}{ARRAY}, +diff --git a/t/Carp_overloadless.t b/t/Carp_overloadless.t +index f4bda04..6b73601 100644 +--- a/t/Carp_overloadless.t ++++ b/t/Carp_overloadless.t +@@ -1,12 +1,14 @@ ++use strict; + use warnings; +-#no warnings 'once'; ++ + use Test::More tests => 1; + + use Carp; + + # test that enabling overload without loading overload.pm does not trigger infinite recursion + +-my $p = "OverloadedInXS"; ++no strict 'refs'; ++my $p = "OverloadedInXS"; + *{$p."::(("} = sub{}; + *{$p.q!::(""!} = sub { Carp::cluck "" }; + sub { Carp::longmess("longmess:") }->(bless {}, $p); +diff --git a/t/broken_can.t b/t/broken_can.t +index c32fa19..9232d68 100644 +--- a/t/broken_can.t ++++ b/t/broken_can.t +@@ -1,3 +1,6 @@ ++use strict; ++use warnings; ++ + use Test::More tests => 1; + + # [perl #132910] +@@ -10,6 +13,6 @@ package main; + use Carp; + + eval { +- sub { confess-sins }->(bless[], Foo); ++ sub { confess-sins }->(bless[], 'Foo'); + }; + like $@, qr/^-sins at /; +diff --git a/t/broken_univ_can.t b/t/broken_univ_can.t +index 0ec19d7..49c7720 100644 +--- a/t/broken_univ_can.t ++++ b/t/broken_univ_can.t +@@ -1,15 +1,21 @@ ++use strict; ++use warnings; ++ + # [perl #132910] + # This mock-up breaks Test::More. Don’t use Test::More. + +-sub UNIVERSAL::can { die; } ++{ ++ no warnings 'redefine'; ++ sub UNIVERSAL::can { die; } ++} + + # Carp depends on this to detect the override: +-BEGIN { $UNIVERSAL::can::VERSION = 0xbaff1ed_bee; } ++BEGIN { no warnings 'portable'; $UNIVERSAL::can::VERSION = 0xbaff1ed_bee; } + + use Carp; + + eval { +- sub { confess-sins }->(bless[], Foo); ++ sub { confess-sins }->(bless[], 'Foo'); + }; + print "1..1\n"; + if ($@ !~ qr/^-sins at /) { +diff --git a/t/vivify_stash.t b/t/vivify_stash.t +index 744d0d2..00181f3 100644 +--- a/t/vivify_stash.t ++++ b/t/vivify_stash.t +@@ -1,3 +1,6 @@ ++use strict; ++use warnings; ++ + BEGIN { print "1..5\n"; } + + our $has_utf8; BEGIN { $has_utf8 = exists($::{"utf8::"}); } +@@ -18,7 +21,8 @@ eval { sub { Carp::longmess() }->(\1) }; + print $@ eq '' ? "ok 4 # longmess check1\n" : "not ok 4 # longmess check1\n# $@"; + + # overload:: glob without hash +-undef *{"overload::"}; ++# Clear overload quoted so it happens to the runtime stash. ++{ no strict 'refs'; undef *{"overload::"} } + eval { sub { Carp::longmess() }->(\1) }; + print $@ eq '' ? "ok 5 # longmess check2\n" : "not ok 5 # longmess check2\n# $@"; + +-- +2.30.2 + diff --git a/perl-Carp.spec b/perl-Carp.spec index 391a992..47614b1 100644 --- a/perl-Carp.spec +++ b/perl-Carp.spec @@ -1,13 +1,16 @@ -%define anolis_release 3 +%define anolis_release 1 +%global base_version 1.50 Name: perl-Carp -Version: 1.50 +Version: 1.52 Release: %{anolis_release}%{?dist} Summary: Alternative warn and die for modules -License: GPL+ or Artistic +License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: http://search.cpan.org/dist/Carp/ -Source0: https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX/Carp-%{version}.tar.gz +Source0: https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX/Carp-%{base_version}.tar.gz BuildArch: noarch +# Unbundled from perl 5.34.0 +Patch0: Carp-1.50-Upgrade-to-1.52.patch BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter @@ -24,7 +27,6 @@ BuildRequires: perl(Data::Dumper) BuildRequires: perl(IPC::Open3) BuildRequires: perl(overload) BuildRequires: perl(Test::More) >= 0.47 -Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) # Do not export private DB module stub %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\(DB\\) @@ -47,7 +49,7 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%autosetup -n Carp-%{version} -p1 +%autosetup -n Carp-%{base_version} -p1 %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 @@ -68,6 +70,10 @@ make test %doc Changes README %changelog +* Tue Feb 07 2023 mgb01105731 - 1.52-1 +- remove versioned MODULE_COMPAT_ requires +- update to version 1.52 + * Mon Jan 30 2023 Chunmei Xu - 1.50-3 - rebuild with perl 5.36.0 -- Gitee