Skip to content

Commit

Permalink
Version 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
jplesnik committed Jan 19, 2022
1 parent 74743f5 commit 8c5890a
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub wanted {

WriteMakefile(
'NAME' => 'generators',
'VERSION' => '1.12',
'VERSION' => '1.13',
'AUTHOR' => 'Jitka Plesnikova <[email protected]>',
'LICENSE' => 'gpl',
'EXE_FILES' => [ "bin/perl.prov$suffix", "bin/perl.req$suffix" ],
Expand Down
38 changes: 38 additions & 0 deletions t/10_filename_with_space.t
Original file line number Diff line number Diff line change
@@ -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.");

28 changes: 28 additions & 0 deletions t/data space/file with space
Original file line number Diff line number Diff line change
@@ -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};

3 changes: 2 additions & 1 deletion template/bin/perl.req
Original file line number Diff line number Diff line change
Expand Up @@ -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]+)\)/;
}
Expand Down

0 comments on commit 8c5890a

Please sign in to comment.