diff --git a/Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch b/Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch new file mode 100644 index 0000000000000000000000000000000000000000..a8e3d092a14adecf004320fee129a1cbe2d9d727 --- /dev/null +++ b/Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch @@ -0,0 +1,41 @@ +From 5d2a74bbbd12043880d0fab552e104d8ec9e3bd1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 25 Sep 2019 11:55:56 +0200 +Subject: [PATCH] Fix a typo in clean() warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The tests show: + +t/builder-extra-dir.t .. ok +Use of uninitialized value $1 in concatenation (.) or string at /home/test/fedora/perl-Test-Directory/Test-Directory-0.051/blib/lib/Test/Directory.pm line 128. +test-directory-tmp-gRcbe: at t/builder.t line 54. + +This is because a typo in clean() method. A failed rmdir function sets +$! variable, but a croak call interpolates $1 variable that is usually +undefined at that time. + +This patch fixes it. + +Signed-off-by: Petr Písař +--- + lib/Test/Directory.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Test/Directory.pm b/lib/Test/Directory.pm +index a6e6339..dddf250 100644 +--- a/lib/Test/Directory.pm ++++ b/lib/Test/Directory.pm +@@ -127,7 +127,7 @@ sub clean { + rmdir $self->path($dir); + }; + my $rv = rmdir $self->{dir}; +- carp "$self->{dir}: $1" unless $rv; ++ carp "$self->{dir}: $!" unless $rv; + return $rv; + } + +-- +2.21.0 + diff --git a/Test-Directory-0.051.tar.gz b/Test-Directory-0.051.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..716dcaeb8023ac17f472e4d31e37a86d393dc680 Binary files /dev/null and b/Test-Directory-0.051.tar.gz differ diff --git a/perl-Test-Directory.spec b/perl-Test-Directory.spec new file mode 100644 index 0000000000000000000000000000000000000000..94e9806b6a135afd051e2654a9a2a29cdf2c9fc7 --- /dev/null +++ b/perl-Test-Directory.spec @@ -0,0 +1,62 @@ +Name: perl-Test-Directory +Version: 0.051 +Release: 1 +Summary: Perl extension for maintaining test directories +License: GPL+ or Artistic +URL: https://metacpan.org/release/Test-Directory +Source0: https://cpan.metacpan.org/modules/by-module/Test/Test-Directory-%{version}.tar.gz +# Fix reporting a rmdir failure, CPAN RT#130570 +Patch0: Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch +BuildArch: noarch +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(:VERSION) >= 5.6.2 +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +# Run-time: +BuildRequires: perl(Carp) +BuildRequires: perl(Fcntl) +BuildRequires: perl(File::Spec) +BuildRequires: perl(File::Temp) +BuildRequires: perl(strict) +BuildRequires: perl(Test::Builder::Module) +BuildRequires: perl(warnings) +# Tests: +BuildRequires: perl(constant) +BuildRequires: perl(lib) +BuildRequires: perl(Test::Builder::Tester) +BuildRequires: perl(Test::Exception) +BuildRequires: perl(Test::More) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) + +%description +Testing code can involve making sure that files are created and deleted as +expected. Doing this manually can be error prone, as it's easy to forget a +file, or miss that some unexpected file was added. This module simplifies +maintaining test directories by tracking their status as they are modified +or tested with this API, making it simple to test both individual files, as +well as to verify that there are no missing or unknown files. + +%prep +%setup -q -n Test-Directory-%{version} +%patch0 -p1 + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} + +%install +%{make_install} +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +%doc Changes README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Mon Jun 28 2021 Xu Jin - 0.051-1 +- Initial package for openEuler