Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ L<http://github.com/jberger/Module-Build-CleanInstall>

Joel Berger, E<lt>joel.a.berger@gmail.comE<gt>

=head1 ADDITIONAL CONTRIBUTIONS

Randall Sindlinger, E<lt>rsindlin@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012 by Joel Berger
Expand Down
4 changes: 4 additions & 0 deletions lib/Module/Build/CleanInstall.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ L<http://github.com/jberger/Module-Build-CleanInstall>

Joel Berger, E<lt>joel.a.berger@gmail.comE<gt>

=head1 ADDITIONAL CONTRIBUTIONS

Randall Sindlinger, E<lt>rsindlin@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012 by Joel Berger
Expand Down
20 changes: 20 additions & 0 deletions t/packlist.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use strict;
use warnings;

use Test::More;
use Pod::Perldoc;
use File::Spec::Functions qw/splitpath splitdir catpath catdir/;

use Module::Build::CleanInstall;

Expand All @@ -10,6 +12,24 @@ if (grep { m#List-MoreUtils.*?blib# } @INC) {
plan skip_all => "Test irrelevant when not using an installed version of List::MoreUtils";
}

# In distros where List::MoreUtils is a vendor-package, there is no .packlist,
# so ExtUtils::Installed won't see it. Checking for this case. If more than one is
# installed, only looking at first result.
my ($L_MU_path) = Pod::Perldoc->new->grand_search_init(['List::MoreUtils']);
if ($L_MU_path) {note 'List::MoreUtils is available'};

# get the _expected_ .packlist directory in a portable way (using File::Spec functions)
my ($vol,$dir,$file) = splitpath ($L_MU_path, 1); #nofile flag
$dir =~ s/.pm$//;
my @dirs = (splitdir($dir));
my @L_MU_only = splice(@dirs, -2, 2);
my $expected_L_MU_packlist_dir = catdir(@dirs, 'auto', @L_MU_only);

if (-e catpath($vol, $expected_L_MU_packlist_dir) &&
!-e catpath($vol, $expected_L_MU_packlist_dir, '.packlist')) {
plan skip_all => "Test irrelevant when using distro's vendor-package install of List::MoreUtils";
}

my $packlist = Module::Build::CleanInstall->_get_packlist('List::MoreUtils');
ok ($packlist, 'Found packlist for List::MoreUtils');

Expand Down