X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FFatNode.pm;h=cafc47e6976d4831fa3cacb2a6049fa1848e41a8;hp=d93f54c7a2d089e763f45b3ffb8546ddf6a112bc;hb=6845582fdc45bc6623a7f79a8d80ef650c37a3e8;hpb=9a46f6c5479427e967cea4f4ea64b0be7decbd7c diff --git a/lib/Object/Remote/FatNode.pm b/lib/Object/Remote/FatNode.pm index d93f54c..cafc47e 100644 --- a/lib/Object/Remote/FatNode.pm +++ b/lib/Object/Remote/FatNode.pm @@ -16,9 +16,12 @@ sub stripspace { my %maybe_libs = map +($_ => 1), grep defined, (values %Config, '.'); -my @extra_libs = grep -e not(ref($_) or $maybe_libs{$_}), @INC; - -my $extra_libs = join '', map " -I$_\n", @extra_libs; +my @extra_libs = grep not(ref($_) or $maybe_libs{$_}), @INC; +my $extra_libs = join '', map { + my $lib = $_; + $lib =~ s{'}{'\\''}g; + " -I'$lib'\n"; +} @extra_libs; my $command = qq( $^X @@ -34,7 +37,9 @@ my $command = qq( -mObject::Remote::Node -mMethod::Generate::BuildAll -mMethod::Generate::DemolishAll + -mMoo::HandleMoose::_TypeMap -mJSON::PP + -mDevel::GlobalDestruction -e 'print join "\\n", \%INC' ); @@ -43,9 +48,16 @@ $command =~ s/\n/ /g; chomp(my @inc = qx($command)); my %exclude = map { $_ => 1 } @exclude_mods; -my %mods = reverse @inc; + my %file_names = @inc; +# only include mods that match the filename, +# ie ones that will succeed with a require $module +# https://rt.cpan.org/Ticket/Display.html?id=100478 +my %mods = + map { $file_names{$_} => $_ } + grep { $file_names{$_} =~ /\Q$_\E$/ } keys %file_names; + foreach(keys(%mods)) { if ($exclude{ $mods{$_} }) { delete($mods{$_});