Upgrade to 5.76 as provided in perl-5.34.0

This commit is contained in:
Jitka Plesnikova 2021-05-06 07:47:26 +02:00
parent f85d3d2fd7
commit 0af362374c
2 changed files with 216 additions and 4 deletions

View File

@ -0,0 +1,203 @@
From 1a654c6b6248afd9dfe94ac6f11bd0ac23a80c73 Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik@redhat.com>
Date: Wed, 5 May 2021 22:23:24 +0200
Subject: [PATCH] Upgrade to 5.76
---
lib/Exporter.pm | 11 ++++------
lib/Exporter/Heavy.pm | 2 +-
t/Exporter.t | 48 +++++++++++++++++++++++--------------------
t/warn.t | 3 ++-
4 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/lib/Exporter.pm b/lib/Exporter.pm
index 19d7645..28a6873 100644
--- a/lib/Exporter.pm
+++ b/lib/Exporter.pm
@@ -1,16 +1,13 @@
package Exporter;
-require 5.006;
-
-# Be lean.
-#use strict;
-#no strict 'refs';
+use strict;
+no strict 'refs';
our $Debug = 0;
our $ExportLevel = 0;
our $Verbose ||= 0;
-our $VERSION = '5.74';
-our (%Cache);
+our $VERSION = '5.76';
+our %Cache;
sub as_heavy {
require Exporter::Heavy;
diff --git a/lib/Exporter/Heavy.pm b/lib/Exporter/Heavy.pm
index 004815e..404b4c1 100644
--- a/lib/Exporter/Heavy.pm
+++ b/lib/Exporter/Heavy.pm
@@ -4,7 +4,7 @@ use strict;
no strict 'refs';
# On one line so MakeMaker will see it.
-require Exporter; our $VERSION = $Exporter::VERSION;
+our $VERSION = '5.76';
=head1 NAME
diff --git a/t/Exporter.t b/t/Exporter.t
index 0518080..2fcd003 100644
--- a/t/Exporter.t
+++ b/t/Exporter.t
@@ -1,5 +1,8 @@
#!perl -w
+use strict;
+use warnings;
+
# Can't use Test::Simple/More, they depend on Exporter.
my $test;
sub ok ($;$) {
@@ -18,39 +21,36 @@ sub ok ($;$) {
BEGIN {
$test = 1;
- print "1..33\n";
+ print "1..34\n";
require Exporter;
ok( 1, 'Exporter compiled' );
}
-BEGIN {
- # Methods which Exporter says it implements.
- @Exporter_Methods = qw(import
+our @Exporter_Methods = qw(import
export_to_level
require_version
export_fail
);
-}
package Testing;
require Exporter;
-@ISA = qw(Exporter);
+our @ISA = qw(Exporter);
# Make sure Testing can do everything its supposed to.
foreach my $meth (@::Exporter_Methods) {
::ok( Testing->can($meth), "subclass can $meth()" );
}
-%EXPORT_TAGS = (
+our %EXPORT_TAGS = (
This => [qw(stuff %left)],
That => [qw(Above the @wailing)],
tray => [qw(Fasten $seatbelt)],
);
-@EXPORT = qw(lifejacket is);
-@EXPORT_OK = qw(under &your $seat);
-$VERSION = '1.05';
+our @EXPORT = qw(lifejacket is);
+our @EXPORT_OK = qw(under &your $seat);
+our $VERSION = '1.05';
::ok( Testing->require_version(1.05), 'require_version()' );
eval { Testing->require_version(1.11); 1 };
@@ -168,15 +168,15 @@ Testing->import('!/e/');
package More::Testing;
-@ISA = qw(Exporter);
-$VERSION = 0;
+our @ISA = qw(Exporter);
+our $VERSION = 0;
eval { More::Testing->require_version(0); 1 };
::ok(!$@, 'require_version(0) and $VERSION = 0');
package Yet::More::Testing;
-@ISA = qw(Exporter);
-$VERSION = 0;
+our @ISA = qw(Exporter);
+our $VERSION = 0;
eval { Yet::More::Testing->require_version(10); 1 };
::ok($@ !~ /\(undef\)/, 'require_version(10) and $VERSION = 0');
@@ -185,8 +185,8 @@ my $warnings;
BEGIN {
local $SIG{__WARN__} = sub { $warnings = join '', @_ };
package Testing::Unused::Vars;
- @ISA = qw(Exporter);
- @EXPORT = qw(this $TODO that);
+ our @ISA = qw(Exporter);
+ our @EXPORT = qw(this $TODO that);
package Foo;
Testing::Unused::Vars->import;
@@ -196,8 +196,8 @@ BEGIN {
print "# $warnings\n";
package Moving::Target;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw (foo);
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw (foo);
sub foo {"This is foo"};
sub bar {"This is bar"};
@@ -215,12 +215,11 @@ Moving::Target->import ('bar');
::ok (bar() eq "This is bar", "imported bar after EXPORT_OK changed");
package The::Import;
-
use Exporter 'import';
::ok(\&import == \&Exporter::import, "imported the import routine");
-@EXPORT = qw( wibble );
+our @EXPORT = qw( wibble );
sub wibble {return "wobble"};
package Use::The::Import;
@@ -238,8 +237,8 @@ eval { Carp::croak() };
package Exporter::for::Tied::_;
-@ISA = 'Exporter';
-@EXPORT = 'foo';
+our @ISA = 'Exporter';
+our @EXPORT = 'foo';
package Tied::_;
@@ -253,3 +252,8 @@ sub TIESCALAR{bless[]}
}
}
::ok(1, 'import with tied $_');
+
+# this should be loaded, but make sure
+require Exporter::Heavy;
+::ok(Exporter->VERSION eq Exporter::Heavy->VERSION,
+ 'Exporter and Exporter::Heavy have matching versions');
diff --git a/t/warn.t b/t/warn.t
index 3010964..2186674 100644
--- a/t/warn.t
+++ b/t/warn.t
@@ -25,7 +25,8 @@ BEGIN {
package Foo;
Exporter->import("import");
-@EXPORT_OK = "bar";
+our @EXPORT_OK = qw/bar/;
+
package main;
--
2.30.2

View File

@ -1,3 +1,5 @@
%global base_version 5.74
# Run optional test
%if ! (0%{?rhel})
%bcond_without perl_Exporter_enables_optional_test
@ -6,13 +8,16 @@
%endif
Name: perl-Exporter
Version: 5.74
Release: 459%{?dist}
Version: 5.76
Release: 1%{?dist}
Summary: Implements default import method for modules
License: GPL+ or Artistic
URL: https://metacpan.org/release/Exporter
Source0: https://cpan.metacpan.org/authors/id/T/TO/TODDR/Exporter-%{version}.tar.gz
Source0: https://cpan.metacpan.org/authors/id/T/TO/TODDR/Exporter-%{base_version}.tar.gz
# Unbundled from perl 5.34.0
Patch0: Exporter-5.74-Upgrade-to-5.76.patch
BuildArch: noarch
BuildRequires: coreutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
@ -40,7 +45,8 @@ provides a highly flexible interface, with an implementation optimized for
the common case.
%prep
%setup -q -n Exporter-%{version}
%setup -q -n Exporter-%{base_version}
%patch0 -p1
%build
perl Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 INSTALLDIRS=vendor
@ -59,6 +65,9 @@ make test
%{_mandir}/man3/*
%changelog
* Wed May 05 2021 Jitka Plesnikova <jplesnik@redhat.com> - 5.76-1
- Upgrade to 5.76 as provided in perl-5.34.0
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.74-459
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild