From dd683065b59960d03e65304b7eaca9b4a7f92f98 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: May 13 2019 15:57:42 +0000 Subject: Fix rm() method to respect an option for not changing a working directory --- diff --git a/File-Path-Tiny-0.9-Fix-rm-method-to-respect-an-option-for-not-changing-.patch b/File-Path-Tiny-0.9-Fix-rm-method-to-respect-an-option-for-not-changing-.patch new file mode 100644 index 0000000..3a97680 --- /dev/null +++ b/File-Path-Tiny-0.9-Fix-rm-method-to-respect-an-option-for-not-changing-.patch @@ -0,0 +1,36 @@ +From 3ce2252d7911df15e837b61b4c2ecff9e1c3d86b Mon Sep 17 00:00:00 2001 +From: ishigaki +Date: Mon, 13 May 2019 17:54:35 +0200 +Subject: [PATCH] Fix rm() method to respect an option for not changing a + working directory +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +File::Path::Tiny::rm always changes directory if there's a subdirectory +because $fast option is not passed correctly. Here's a patch. + +From: +CPAN RT#125502 + +Signed-off-by: Petr Písař +--- + lib/File/Path/Tiny.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/File/Path/Tiny.pm b/lib/File/Path/Tiny.pm +index f8b5f14..e8298d1 100644 +--- a/lib/File/Path/Tiny.pm ++++ b/lib/File/Path/Tiny.pm +@@ -67,7 +67,7 @@ sub empty_dir { + my $long = File::Spec->catdir( $path, $thing ); + if ( !-l $long && -d _ ) { + _bail_if_changed( $path, $orig_dev, $orig_ino ); +- rm($long) or !-e $long or return; ++ rm( $long, $fast ) or !-e $long or return; + } + else { + _bail_if_changed( $path, $orig_dev, $orig_ino ); +-- +2.20.1 + diff --git a/perl-File-Path-Tiny.spec b/perl-File-Path-Tiny.spec index e2b0d0d..3e37b7a 100644 --- a/perl-File-Path-Tiny.spec +++ b/perl-File-Path-Tiny.spec @@ -1,10 +1,13 @@ Name: perl-File-Path-Tiny Version: 0.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Recursive versions of mkdir() and rmdir() without as much overhead as File::Path License: GPL+ or Artistic URL: https://metacpan.org/release/File-Path-Tiny Source0: https://cpan.metacpan.org/authors/id/D/DM/DMUEY/File-Path-Tiny-%{version}.tar.gz +# Fix rm() method to respect an option for not changing a working directory, +# CPAN RT#125502, proposed to upstream +Patch0: File-Path-Tiny-0.9-Fix-rm-method-to-respect-an-option-for-not-changing-.patch BuildArch: noarch # Build BuildRequires: make @@ -29,6 +32,7 @@ rmdir() with as little code and overhead as possible. %prep %setup -q -n File-Path-Tiny-%{version} +%patch0 -p1 %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 @@ -47,6 +51,10 @@ make test %{_mandir}/man3/* %changelog +* Mon May 13 2019 Petr Pisar - 0.9-6 +- Fix rm() method to respect an option for not changing a working directory + (CPAN RT#125502) + * Fri Feb 01 2019 Fedora Release Engineering - 0.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild