diff --git a/README.pod b/README.pod index b37abfe..49b3f44 100644 --- a/README.pod +++ b/README.pod @@ -39,6 +39,10 @@ L Joel Berger, Ejoel.a.berger@gmail.comE +=head1 ADDITIONAL CONTRIBUTIONS + +Randall Sindlinger, Ersindlin@gmail.comE + =head1 COPYRIGHT AND LICENSE Copyright (C) 2012 by Joel Berger diff --git a/lib/Module/Build/CleanInstall.pm b/lib/Module/Build/CleanInstall.pm index 77bae06..e3d1ef2 100644 --- a/lib/Module/Build/CleanInstall.pm +++ b/lib/Module/Build/CleanInstall.pm @@ -86,6 +86,10 @@ L Joel Berger, Ejoel.a.berger@gmail.comE +=head1 ADDITIONAL CONTRIBUTIONS + +Randall Sindlinger, Ersindlin@gmail.comE + =head1 COPYRIGHT AND LICENSE Copyright (C) 2012 by Joel Berger diff --git a/t/packlist.t b/t/packlist.t index e64d7fb..8ba1927 100644 --- a/t/packlist.t +++ b/t/packlist.t @@ -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; @@ -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');