From 8c5890a02ece9ca07112296909a89c195e749912 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Wed, 19 Jan 2022 20:20:41 +0100 Subject: [PATCH] Version 1.13 --- Changes | 3 +++ Makefile.PL | 2 +- t/10_filename_with_space.t | 38 ++++++++++++++++++++++++++++++++++++ t/data space/file with space | 28 ++++++++++++++++++++++++++ template/bin/perl.req | 3 ++- 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 t/10_filename_with_space.t create mode 100644 t/data space/file with space diff --git a/Changes b/Changes index 2223fa0..a4181c0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for perl-generators. +1.13 Fri May 7 2021 +- Fix broken call to perl.prov when filenames contain spaces + 1.12 Wed Feb 10 2021 - Add perltest.attr to generate dependencies for tests sub-packages diff --git a/Makefile.PL b/Makefile.PL index 17f1c9e..3b65354 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -38,7 +38,7 @@ sub wanted { WriteMakefile( 'NAME' => 'generators', - 'VERSION' => '1.12', + 'VERSION' => '1.13', 'AUTHOR' => 'Jitka Plesnikova ', 'LICENSE' => 'gpl', 'EXE_FILES' => [ "bin/perl.prov$suffix", "bin/perl.req$suffix" ], diff --git a/t/10_filename_with_space.t b/t/10_filename_with_space.t new file mode 100644 index 0000000..4abea2b --- /dev/null +++ b/t/10_filename_with_space.t @@ -0,0 +1,38 @@ +use strict; +use warnings; +use Test::More tests => 2; +use Test::Simple; + +use lib 't/lib'; +use PerlNS qw($PERL_NAMESPACE $PERL_PROV $PERL_REQ); + +my $perl_ns = $PERL_NAMESPACE; + +my $files = "t/data space/file with space"; +my @requires = qx($PERL_REQ '$files'); +my @provides = qx($PERL_PROV '$files'); + +# +# Provides +is(scalar(@provides), 0, 'No package is provided'); + +# +# Requires +my @expectedrequires = ( + "$perl_ns(:VERSION) >= 5.10.0\n", + "$perl_ns(Alpha) >= 0.12\n", + "$perl_ns(Alpha::One)\n", + "$perl_ns(Alpha::Two)\n", + "$perl_ns(Beta)\n", + "$perl_ns(Epsilon)\n", + "$perl_ns(Eta)\n", + "$perl_ns(ExtUtils::MM_Unix)\n", + "$perl_ns(Gamma)\n", + "$perl_ns(Iota)\n", + "$perl_ns(Kappa)\n", + "$perl_ns(Lambda)\n", + "$perl_ns(Theta)\n", +); + +is_deeply([ sort @requires ], [ sort @expectedrequires ], "Only expected requires were found."); + diff --git a/t/data space/file with space b/t/data space/file with space new file mode 100644 index 0000000..8ba52c7 --- /dev/null +++ b/t/data space/file with space @@ -0,0 +1,28 @@ +# Inversioned Alpha should not be listed +use Alpha; +use Alpha 0.12; + +use Alpha::One; +use qw(Alpha::Two); +use Beta (); +require Gamma; +use ExtUtils::MM_Unix; + +eval { require Delta }; + +# TODO: Don't recognize more than one 'use' or 'require' at one line +use Epsilon; use Zeta; + +require v5.6.1; +require 5.006_001; +use 5.010; + +# 'use' does not accept module name with .pm +use 'Ignore.pm'; + +require Eta; +require 'Theta.pm'; +require "Iota.pm"; +require q !Kappa.pm!; +require qq{Lambda.pm}; + diff --git a/template/bin/perl.req b/template/bin/perl.req index e677575..1a87525 100755 --- a/template/bin/perl.req +++ b/template/bin/perl.req @@ -409,7 +409,8 @@ sub process_file_provides { return if (! $HAVE_PROV); - my @result = readpipe( "$prov_script $file" ); + $file =~ s/'/'"'"'/g; + my @result = readpipe( "$prov_script '$file'" ); foreach my $prov (@result) { $provide{$1} = undef if $prov =~ /perl\(([_:a-zA-Z0-9]+)\)/; }