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=8b143b8c13cb6bf2543745d5bbbf17d89f0545c0;hp=45332d542b6f7f31b7029db7396ef2c2e33d6354;hb=bef36e73e4257b2ba8e59eb55661ffc51d8a620a;hpb=1bf553077ee5e7d9fd912783384e442165062f14 diff --git a/lib/Object/Remote/FatNode.pm b/lib/Object/Remote/FatNode.pm index 45332d5..8b143b8 100644 --- a/lib/Object/Remote/FatNode.pm +++ b/lib/Object/Remote/FatNode.pm @@ -17,15 +17,18 @@ sub stripspace { my %maybe_libs = map +($_ => 1), grep defined, (values %Config, '.'); my @extra_libs = grep not(ref($_) or $maybe_libs{$_}), @INC; - -my $extra_libs = join '', map " -I$_\n", @extra_libs; +my $extra_libs = join '', map { + my $lib = $_; + $lib =~ s{'}{'\\''}g; + " -I'$lib'\n"; +} @extra_libs; my $command = qq( $^X $extra_libs -mObject::Remote -mObject::Remote::Connector::STDIO - -mCPS::Future + -mFuture -mMRO::Compat -mClass::C3 -mClass::C3::next @@ -34,6 +37,7 @@ my $command = qq( -mObject::Remote::Node -mMethod::Generate::BuildAll -mMethod::Generate::DemolishAll + -mMoo::HandleMoose::_TypeMap -mJSON::PP -e 'print join "\\n", \%INC' ); @@ -43,9 +47,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{$_});