Merge pull request !1 from wisdoman/master
This commit is contained in:
openeuler-ci-bot 2020-01-13 11:41:13 +08:00 committed by Gitee
commit 2a620dc591
3 changed files with 139 additions and 0 deletions

View File

@ -0,0 +1,74 @@
From d4b0f5dd2665dfe0124623379bfb6ce233cdd075 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 6 May 2019 15:22:32 +0200
Subject: [PATCH] Fix Perl version lookup with Module::CoreList
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If a distribution declares a dependency on '5.010' Perl,
inc::Module::Install dies in
Module::Install::Admin::ScanDeps::scan_dependencies() with:
Module::CoreList has no information on perl 5.010 at /usr/lib/perl5/ site_perl/5.10.1/Module/Install/Admin/ScanDeps.pm line 25.
This is because %Module::CoreList::version is indiced only with some
arbitrary versions and normalized numeral versions only. E.g. it
contains an entry for 5.005, 5.005000 and 5.010000 but no entry of 5.010.
This patch fixes the lookup by converting a version string into
a numeral.
https://rt.cpan.org/Public/Bug/Display.html?id=71565
https://github.com/Perl-Toolchain-Gang/Module-Install/pull/47
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/Module/Install/Admin/ScanDeps.pm | 1 +
t/35_perl_version.t | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
create mode 100644 t/35_perl_version.t
diff --git a/lib/Module/Install/Admin/ScanDeps.pm b/lib/Module/Install/Admin/ScanDeps.pm
index a75ba6e..9cee31e 100644
--- a/lib/Module/Install/Admin/ScanDeps.pm
+++ b/lib/Module/Install/Admin/ScanDeps.pm
@@ -18,6 +18,7 @@ Please first specify a required perl version, like this:
perl_version('5.005');
END_MESSAGE
$perl_version =~ s{^(\d+)\.(\d+)\.(\d+)}{$1 + $2/1_000 + $3/1_000_000}e;
+ $perl_version = 0 + $perl_version;
require Module::ScanDeps;
require Module::CoreList;
diff --git a/t/35_perl_version.t b/t/35_perl_version.t
new file mode 100644
index 0000000..888b8c0
--- /dev/null
+++ b/t/35_perl_version.t
@@ -0,0 +1,23 @@
+use strict;
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+use Test::More;
+
+my @existing_versions = ( qw(5.005 5.01 5.010 5.0100 5.01000 5.010000 5.10.0
+ 5.010.000) );
+my @missing_versions = ( qw(5.005002 5.5.2) );
+plan tests => 1 + @existing_versions + @missing_versions;
+
+require_ok( 'Module::Install::Admin::ScanDeps' );
+my $m = Module::Install::Admin::ScanDeps->new;
+
+for my $version (@existing_versions) {
+ eval { $m->scan_dependencies(q{Carp}, $version, q{0}) };
+ ok(!$@, "scan_dependencies() can query core modules for $version Perl");
+}
+for my $version (@missing_versions) {
+ eval { $m->scan_dependencies(q{Carp}, $version, q{0}) };
+ ok($@, "scan_dependencies() cannot query core modules for $version Perl");
+}
--
2.20.1

BIN
Module-Install-1.19.tar.gz Normal file

Binary file not shown.

65
perl-Module-Install.spec Normal file
View File

@ -0,0 +1,65 @@
Name: perl-Module-Install
Version: 1.19
Release: 8
Summary: Standalone, extensible Perl module installer
License: GPL+ or Artistic
URL: https://metacpan.org/release/Module-Install
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/Module-Install-%{version}.tar.gz
Patch0001: Module-Install-1.19-Fix-Perl-version-lookup-with-Module-CoreList.patch
BuildArch: noarch
BuildRequires: coreutils make perl-generators perl-interpreter perl(lib) perl(strict) perl(warnings)
BuildRequires: perl(Config) perl(Cwd) perl(Devel::PPPort) >= 3.16 perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: perl(ExtUtils::Manifest) perl(ExtUtils::MM_Unix) perl(Fcntl) perl(File::Basename)
BuildRequires: perl(File::Find) perl(File::Path) perl(File::Remove) >= 1.42 perl(File::Spec) >= 3.28
BuildRequires: perl(File::Temp) perl(FileHandle) perl(FindBin) perl(Module::CoreList) >= 2.17
BuildRequires: perl(Module::ScanDeps) >= 1.09 perl(Parse::CPAN::Meta) >= 1.4413 perl(vars) perl(utf8)
BuildRequires: perl(YAML::Tiny) >= 1.38 perl(autodie) perl(ExtUtils::MM) perl(Symbol) perl(Test::More)
%if 0%{!?perl_bootstrap:1}
BuildRequires: perl(Module::Install::AuthorTests) perl(Module::Install::ExtraTests) >= 0.007
%endif
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version)) perl(Archive::Zip) >= 1.37
Requires: perl(Carp) perl(CPAN) perl(Devel::PPPort) >= 3.16 perl(ExtUtils::MakeMaker) >= 6.59
Recommends: perl(CPANPLUS::Backend)
Requires: perl(ExtUtils::MM_Unix) perl(File::Remove) >= 1.42 perl(File::Spec) >= 3.28 perl(File::Temp)
Requires: perl(FileHandle) perl(FindBin) perl(Module::Build) >= 0.29 perl(Module::CoreList) >= 2.17
Requires: perl(Module::ScanDeps) >= 1.09 perl(Parse::CPAN::Meta) >= 1.4413 perl(Socket) perl(YAML::Tiny) >= 1.38
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Devel::PPPort\\)$
%global __requires_exclude %__requires_exclude|^perl\\(ExtUtils::MakeMaker\\)$
%global __requires_exclude %__requires_exclude|^perl\\(File::Remove\\)$
%global __requires_exclude %__requires_exclude|^perl\\(File::Spec\\)$
%global __requires_exclude %__requires_exclude|^perl\\(YAML::Tiny\\)$
%description
Module::Install is a package for writing installers for CPAN (or CPAN-like) distributions
that are clean, simple, minimalist, act in a strictly correct manner with ExtUtils::MakeMaker,
and will run on any Perl installation version 5.005 or newer.
The intent is to make it as easy as possible for CPAN authors (and especially for first-time
CPAN authors) to have installers that follow all the best practices for distribution
installation, but involve as much DWIM (Do What I Mean) as possible when writing them.
%prep
%autosetup -n Module-Install-%{version} -p1
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%make_build
%install
%make_install
%{_fixperms} %{buildroot}/*
%check
make test
%files
%doc Changes README
%{perl_vendorlib}/*
%{_mandir}/man3/*
%exclude /blib/lib/auto/share/dist/Module-Install/dist_file.txt
%changelog
* Fri Jan 10 2019 Tianfei <tianfei16@huawei.com> - 1.19-8
- Package init