diff --git a/B-Lint-1.20-Skip-a-bare-sub-test.patch b/B-Lint-1.20-Skip-a-bare-sub-test.patch new file mode 100644 index 0000000..c74e2ab --- /dev/null +++ b/B-Lint-1.20-Skip-a-bare-sub-test.patch @@ -0,0 +1,68 @@ +From d350b6338066d2563b4abacf1eb7da56c5264b22 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 12 Jun 2015 13:27:07 +0200 +Subject: [PATCH] Skip a bare-sub test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Perl 5.22 optimization causes B::Lint not to recognize $a{b} for +bare-sub check. This patch document this deficency and skips a test +for it. + +Signed-off-by: Petr Písař +--- + lib/B/Lint.pm | 4 ++++ + t/lint.t | 11 +++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/lib/B/Lint.pm b/lib/B/Lint.pm +index 1f5098f..7291b18 100644 +--- a/lib/B/Lint.pm ++++ b/lib/B/Lint.pm +@@ -85,6 +85,10 @@ trap are: + + Neither of these will do what a naive user would expect. + ++Notice: Perl 5.22.0 does not report C in C<$b{foo}> as BARE token ++anymore. Therefore L test is not reliable here. See ++L. ++ + =item B + + This option warns whenever C<$_> is used either explicitly anywhere or +diff --git a/t/lint.t b/t/lint.t +index 7317b1d..93255d9 100644 +--- a/t/lint.t ++++ b/t/lint.t +@@ -14,7 +14,7 @@ BEGIN { + use strict; + use warnings; + +-plan tests => 29; ++plan tests => 30; + + # Runs a separate perl interpreter with the appropriate lint options + # turned on +@@ -116,10 +116,17 @@ RESULT + + runlint 'bare-subs', 'sub bare(){1};$x=bare', ''; + +-runlint 'bare-subs', 'sub bare(){1}; $x=[bare=>0]; $x=$y{bare}', <<'RESULT'; ++runlint 'bare-subs', 'sub bare(){1}; $x=[bare=>0]', <<'RESULT'; + Bare sub name 'bare' interpreted as string at -e line 1 ++RESULT ++ ++SKIP: { ++ skip 'Perl 5.22 stopped marking $hash{bare} as BARE word, CPAN RT#101115', ++ 1, if $] >= 5.022; ++ runlint 'bare-subs', 'sub bare(){1}; $x=$y{bare}', <<'RESULT'; + Bare sub name 'bare' interpreted as string at -e line 1 + RESULT ++} + + { + +-- +2.1.0 + diff --git a/B-Lint-1.20.tar.gz b/B-Lint-1.20.tar.gz new file mode 100644 index 0000000..a1c25e0 Binary files /dev/null and b/B-Lint-1.20.tar.gz differ diff --git a/perl-B-Lint.spec b/perl-B-Lint.spec new file mode 100644 index 0000000..df5f00f --- /dev/null +++ b/perl-B-Lint.spec @@ -0,0 +1,49 @@ +Name: perl-B-Lint +Version: 1.20 +Release: 14 +Summary: perl linter +License: GPL+ or Artistic +Group: Development/Libraries +URL: https://metacpan.org/release/B-Lint +Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJBS/B-Lint-%{version}.tar.gz +Patch0: B-Lint-1.20-Skip-a-bare-sub-test.patch +BuildArch: noarch +BuildRequires: findutils make perl-interpreter perl-generators perl(ExtUtils::MakeMaker) +BuildRequires: sed perl(B) perl(Carp) perl(constant) perl(deprecate) perl(if) +BuildRequires: perl(List::Util) perl(Module::Pluggable) perl(overload) perl(strict) +BuildRequires: perl(Config) perl(File::Spec) perl(O) perl(warnings) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(constant) perl(deprecate) + +%description +Provides program checking for Perl programs,equivalent to running Perl with the -w option. +Named after the Unix lint program for checking C programs. + +%package_help + +%prep +%autosetup -n B-Lint-%{version} -p1 +sed -i '/PM *=>/,/}/d' Makefile.PL + +%build +perl Makefile.PL INSTALLDIRS=vendor +%make_build + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +%{perl_vendorlib}/* + +%files help +%doc Changes README +%{_mandir}/man3/* + +%changelog +* Thu Apr 16 2020 wangyue - 1.20-14 +- Package init diff --git a/perl-B-Lint.yaml b/perl-B-Lint.yaml new file mode 100644 index 0000000..1244de0 --- /dev/null +++ b/perl-B-Lint.yaml @@ -0,0 +1,4 @@ +version_control: metacpan +src_repo: B-Lint +tag_prefix: "^v" +seperator: "."