whole-name-quoted filename can't be read [cpan #57586] #14003
Comments
From @jkeenan[Since ExtUtils-Manifest is now primarily maintained by Perl 5 Porters, I am moving this ticket here from https://rt.cpan.org/Ticket/Display.html?id=57586. -- jkeenan] While adding support for quoted filenames (names with spaces) to Dist::Zilla, I found this bug use strict; my $manifest_content = <<'END_MANIFEST'; { my $manifest = maniread; print "$_\n" for keys %$manifest; This should print: 'quoted name.txt' Instead, it prints: quoted name.txt' -- |
From @jkeenanSummary of my perl5 (revision 5 version 21 subversion 3) configuration: Characteristics of this binary (from libperl): |
From @jkeenanOn Sun Jul 27 16:05:08 2014, jkeenan wrote:
Please review the patch attached. Thank you very much. |
From @jkeenan122415-0001-Have-maniread-properly-handle-whole-name-quoted-file.patchFrom 7d52cf1a331ada2f5eadb4f466501dd84a5c4745 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Sun, 27 Jul 2014 19:11:35 -0400
Subject: [PATCH] Have maniread() properly handle whole-name-quoted filename.
Add test using existing test format.
For: RT #122415 (formerly cpan #57586)
---
dist/ExtUtils-Manifest/lib/ExtUtils/Manifest.pm | 4 ++--
dist/ExtUtils-Manifest/t/Manifest.t | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dist/ExtUtils-Manifest/lib/ExtUtils/Manifest.pm b/dist/ExtUtils-Manifest/lib/ExtUtils/Manifest.pm
index 165a15c..bf92c8f 100644
--- a/dist/ExtUtils-Manifest/lib/ExtUtils/Manifest.pm
+++ b/dist/ExtUtils-Manifest/lib/ExtUtils/Manifest.pm
@@ -12,7 +12,7 @@ use warnings;
use Exporter 5.57 'import';
-our $VERSION = '1.64';
+our $VERSION = '1.65';
our @EXPORT_OK = qw(mkmanifest
manicheck filecheck fullcheck skipcheck
manifind maniread manicopy maniadd
@@ -354,7 +354,7 @@ sub maniread {
# filename may contain spaces if enclosed in ''
# (in which case, \\ and \' are escapes)
- if (($file, $comment) = /^'(\\[\\']|.+)+'\s*(.*)/) {
+ if (($file, $comment) = /^'((?:\\[\\']|.+)+)'\s*(.*)/) {
$file =~ s/\\([\\'])/$1/g;
}
else {
diff --git a/dist/ExtUtils-Manifest/t/Manifest.t b/dist/ExtUtils-Manifest/t/Manifest.t
index a6a89a2..cc61401 100644
--- a/dist/ExtUtils-Manifest/t/Manifest.t
+++ b/dist/ExtUtils-Manifest/t/Manifest.t
@@ -13,7 +13,7 @@ chdir 't';
use strict;
-use Test::More tests => 96;
+use Test::More tests => 97;
use Cwd;
use File::Spec;
@@ -324,6 +324,20 @@ SKIP: {
$funky_files{'space_quote_backslash'} = 'foo bar\\baz\'quux';
}
+# test including a filename which is itself a quoted string
+# https://rt.perl.org/Ticket/Display.html?id=122415
+SKIP: {
+ my $quoted_filename = q{'quoted name.txt'};
+ my $description = "quoted string";
+ add_file( $quoted_filename => $description )
+ or skip "couldn't create $description test file", 1;
+ local $ExtUtils::Manifest::MANIFEST = "albatross";
+ maniadd({ $quoted_filename => $description });
+ is( maniread()->{$quoted_filename}, $description,
+ 'file whose name starts and ends with quotes' );
+ $funky_files{$description} = $quoted_filename;
+}
+
my @funky_keys = qw(space space_quote space_backslash space_quote_backslash);
# test including an external manifest.skip file in MANIFEST.SKIP
{
--
1.9.1
|
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Sun Jul 27 16:16:02 2014, jkeenan wrote:
rjbs: Although it appears the Toolchain Gang will ultimately take responsibility for ExtUtils-Manifest, could you review this patch, as you were the OP? Thank you very much. |
From @rjbsOn Mon Aug 04 16:02:49 2014, jkeenan wrote:
With this patch, my original test code behaves as expected. -- |
From @jkeenanOn Tue Aug 05 07:36:52 2014, rjbs wrote:
Thanks. I've asked the Toolchain Gang folks to clarify the ExtUtils-Manifest maintenance issue: |
From @jkeenanOn Tue Aug 05 16:17:21 2014, jkeenan wrote:
Patch applied upstream: Perl-Toolchain-Gang/ExtUtils-Manifest#1 Patch applied to blead as part of: commit 9a7aaf5 Update ExtUtils-Manifest to CPAN version 1.66 Marking ticket resolved. |
@jkeenan - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#122415 (status was 'resolved')
Searchable as RT122415$
The text was updated successfully, but these errors were encountered: