From 22169f1a80456cf753f7ca09e2c64c193dd6c7e36855383b23fa879839934afd Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Sat, 5 Aug 2023 11:46:34 +0000 Subject: [PATCH 1/2] Accepting request 1102308 from home:dimstar:Factory - Add test-perl-5.38.patch: Don't simultaneously test -c and -v switches. Patch based on https://patch-diff.githubusercontent.com/raw/manwar/Test-Strict/pull/33.patch. OBS-URL: https://build.opensuse.org/request/show/1102308 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Test-Strict?expand=0&rev=34 --- cpanspec.yml | 3 +- perl-Test-Strict.changes | 7 +++ perl-Test-Strict.spec | 7 ++- test-perl-5.38.patch | 108 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 test-perl-5.38.patch diff --git a/cpanspec.yml b/cpanspec.yml index 9b320f5..11e7573 100644 --- a/cpanspec.yml +++ b/cpanspec.yml @@ -4,7 +4,8 @@ #sources: # - source1 # - source2 -#patches: +patches: + test-perl-5.38.patch: -p1 # foo.patch: -p1 # bar.patch: #preamble: |- diff --git a/perl-Test-Strict.changes b/perl-Test-Strict.changes index fa0d624..5cf4af2 100644 --- a/perl-Test-Strict.changes +++ b/perl-Test-Strict.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Aug 3 12:57:32 UTC 2023 - Dominique Leuenberger + +- Add test-perl-5.38.patch: Don't simultaneously test -c and -v + switches. Patch based on +https://patch-diff.githubusercontent.com/raw/manwar/Test-Strict/pull/33.patch. + ------------------------------------------------------------------- Tue Jun 18 05:33:20 UTC 2019 - Stephan Kulow diff --git a/perl-Test-Strict.spec b/perl-Test-Strict.spec index 153cb65..d58a1da 100644 --- a/perl-Test-Strict.spec +++ b/perl-Test-Strict.spec @@ -1,7 +1,7 @@ # # spec file for package perl-Test-Strict # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,9 +23,11 @@ Release: 0 Summary: Check syntax, presence of use strict; and test coverage License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl -Url: https://metacpan.org/release/%{cpan_name} +URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/M/MA/MANWAR/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml +# PATCH-FIX-UPSTREAM test-perl-5.38.patch gh#manwar/Test-Strict#33 -- Don't simultaneously test -c and -v switches +Patch0: test-perl-5.38.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl @@ -54,6 +56,7 @@ controlled by '$Test::Strict::UNTAINT_PATTERN'. %prep %setup -q -n %{cpan_name}-%{version} +%patch0 -p1 %build perl Makefile.PL INSTALLDIRS=vendor diff --git a/test-perl-5.38.patch b/test-perl-5.38.patch new file mode 100644 index 0000000..76d9f88 --- /dev/null +++ b/test-perl-5.38.patch @@ -0,0 +1,108 @@ +From 8cc3a355b90db21b76374d3b563df3628b31d58c Mon Sep 17 00:00:00 2001 +From: James E Keenan +Date: Sat, 14 Jan 2023 22:42:22 +0000 +Subject: [PATCH] Don't simultaneously test -c and -v switches + +Up through perl-5.37.3, there was a bug in perl (see +https://github.com/Perl/perl5/issues/20252#issuecomment-1236880872) +which permitted simultaneous use of the '-c' and '-v' switches to the +perl interpreter. Once this bug was corrected, t/01all.t began to fail. +As Test::Strict has many CPAN distributions depending on it, this test +failure has had wide impact. + +This pull request modifies tests appropriately and has been tested on +bleadperl (v5.37.7-134-g25948dfb24) and on perl-5.32.1, in both cases on +threaded builds on FreeBSD-12. Devel::Cover was not installed on +bleadperl, hence t/04cover.t was skipped on that build. Otherwise, all +tests are passing. In the course of testing, certain additions were +made to .gitignore and MANIFEST.SKIP to get metadata-oriented tests to +pass. + +NOTE: In my git checkout I find the following file: + + .git/hooksfsmonitor-watchman.sample + +This is deemed by 'file' to be a Perl executable. As such, it is pushed +onto the list of files tested by 'all_perl_files_ok()' at the start of +t/01all.t. This in turn means that in my 'git checkout' the count of +tests is off by 2 and the test is reported to fail. + + "Looks like you planned 59 tests but ran 61." + +Because the files in .git/hooks/ should not be included in the tarball, +the count of tests is correct when run from the tarball. I leave to the +maintainer to determine how to square this circle. You should probably +check for the presence of a .git/ directory and exclude that directory +from the list of directories passed to all_perl_files_ok(). + +For https://github.com/manwar/Test-Strict/issues/32 +--- + .gitignore | 2 ++ + MANIFEST.SKIP | 5 +++-- + t/01all.t | 4 +--- + t/02fail.t | 3 +-- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP +index 6dd7c05..03e0675 100644 +--- a/MANIFEST.SKIP ++++ b/MANIFEST.SKIP +@@ -1,4 +1,5 @@ +-^\.git ++\.gitignore ++\.git/ + maint + ^tags$ + .last_cover_stats +@@ -8,7 +9,7 @@ Makefile$ + ^.*.bak + ^.*.old + ^t.*sessions +-^cover_db ++cover_db/ + ^.*\.log + ^.*\.swp$ + ^.*~$ +diff --git a/t/01all.t b/t/01all.t +index 6ff9f23..569354d 100644 +--- a/t/01all.t ++++ b/t/01all.t +@@ -125,8 +125,6 @@ subtest perl_v5_12 => sub { + strict_ok($filename); + }; + +-exit; +- + { + my %data; + sub make_file { +@@ -172,7 +170,7 @@ sub make_warning_files { + + my ($fh2, $filename2) = tempfile( DIR => $tmpdir, SUFFIX => '.pl' ); + print $fh2 <<'DUMMY'; +-#!/usr/bin/perl -vw ++#!/usr/bin/perl -w + use strict; + print "Hello world"; + +diff --git a/t/02fail.t b/t/02fail.t +index d4729cc..b0c8493 100644 +--- a/t/02fail.t ++++ b/t/02fail.t +@@ -40,7 +40,6 @@ TODO: { + ok !Test::Strict::_strict_ok($fh1), 'use strict in print'; + } + +-exit; + + + sub test1 { +@@ -199,7 +198,7 @@ DUMMY + + my ($fh2, $filename2) = tempfile( DIR => $tmpdir, SUFFIX => '.pl' ); + print $fh2 <<'DUMMY'; +-#!/usr/bin/perl -vw ++#!/usr/bin/perl -w + use strict; + print "Hello world"; + From 34de2af1115d8e07079dda7e979ef4d07766538509eebbf109a2b915be99288c Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Sat, 5 Aug 2023 11:49:58 +0000 Subject: [PATCH 2/2] refresh spec with cpanspec OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Test-Strict?expand=0&rev=35 --- cpanspec.yml | 2 +- perl-Test-Strict.spec | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cpanspec.yml b/cpanspec.yml index 11e7573..44669e9 100644 --- a/cpanspec.yml +++ b/cpanspec.yml @@ -5,7 +5,7 @@ # - source1 # - source2 patches: - test-perl-5.38.patch: -p1 + test-perl-5.38.patch: -p1 PATCH-FIX-UPSTREAM test-perl-5.38.patch gh#manwar/Test-Strict#33 -- Don't simultaneously test -c and -v switches # foo.patch: -p1 # bar.patch: #preamble: |- diff --git a/perl-Test-Strict.spec b/perl-Test-Strict.spec index d58a1da..0e1f7b0 100644 --- a/perl-Test-Strict.spec +++ b/perl-Test-Strict.spec @@ -16,22 +16,21 @@ # +%define cpan_name Test-Strict Name: perl-Test-Strict Version: 0.52 Release: 0 -%define cpan_name Test-Strict -Summary: Check syntax, presence of use strict; and test coverage License: Artistic-1.0 OR GPL-1.0-or-later -Group: Development/Libraries/Perl +Summary: Check syntax, presence of use strict; and test coverage URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/M/MA/MANWAR/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml # PATCH-FIX-UPSTREAM test-perl-5.38.patch gh#manwar/Test-Strict#33 -- Don't simultaneously test -c and -v switches Patch0: test-perl-5.38.patch BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.64 BuildRequires: perl(IO::Scalar) BuildRequires: perl(Test::More) >= 1.00 %{perl_requires} @@ -55,12 +54,11 @@ paths are untainted with the following pattern: 'qr|^([-+@\w./:\\]+)$|' controlled by '$Test::Strict::UNTAINT_PATTERN'. %prep -%setup -q -n %{cpan_name}-%{version} -%patch0 -p1 +%autosetup -n %{cpan_name}-%{version} -p1 %build perl Makefile.PL INSTALLDIRS=vendor -make %{?_smp_mflags} +%make_build %check make test @@ -71,7 +69,6 @@ make test %perl_gen_filelist %files -f %{name}.files -%defattr(-,root,root,755) %doc Changes README %license LICENSE