update comment about empty config vars and regexs in fatnode module shipping filters
[scpubgit/Object-Remote.git] / lib / Object / Remote / FatNode.pm
index 3a7025c..9ea7250 100644 (file)
@@ -54,16 +54,10 @@ foreach(keys(%mods)) {
   }
 }
 
-#TODO quick and dirty mod for testing - vendorarchexp from a perlbrew build
-#was set to '' which evaluates as a true regex
-
-#use Data::Dumper;
-#print STDERR Dumper([keys %mod_files]);
-#print STDERR Dumper([keys %mods]);
-
 my @non_core_non_arch = ( $mod_files{'Devel/GlobalDestruction.pm'} );
 push @non_core_non_arch, grep +(
   not (
+    #some of the config variables can be empty which will eval as a matching regex
     $Config{privlibexp} ne '' && /^\Q$Config{privlibexp}/ 
       or $Config{archlibexp} ne '' && /^\Q$Config{archlibexp}/
       or $Config{vendorarchexp} ne '' && /^\Q$Config{vendorarchexp}/
@@ -100,6 +94,10 @@ if (defined($ENV{OBJECT_REMOTE_LOG_FORWARDING})) {
   my $forwarding = $ENV{OBJECT_REMOTE_LOG_FORWARDING};
   $env_pass .= '$ENV{OBJECT_REMOTE_LOG_FORWARDING} = "' . $forwarding . "\";\n";
 }
+if (defined($ENV{OBJECT_REMOTE_PERL_BIN})) {
+  my $perl_bin = $ENV{OBJECT_REMOTE_PERL_BIN};
+  $env_pass .= '$ENV{OBJECT_REMOTE_PERL_BIN} = "' . $perl_bin . "\";\n";
+}
 
 my $start = stripspace <<'END_START';
   # This chunk of stuff was generated by Object::Remote::FatNode. To find
@@ -156,8 +154,11 @@ sub generate_fatpack_hash {
   my $data = $files{$orig} or die $orig; $data =~ s/^/  /mg;
   return () if $did_pack{$hash_name}{$orig};
   $did_pack{$hash_name}{$orig} = 1;
-  return '$'.$hash_name.'{'.perlstring($orig).qq!} = <<'${name}';\n!
-  .qq!${data}${name}\n!;
+  $data .= "\n" unless $data =~ m/\n$/;
+  my $ret = '$'.$hash_name.'{'.perlstring($orig).qq!} = <<'${name}';\n!
+    .qq!${data}${name}\n!;
+#  warn $ret;
+  return $ret;
 }
 
 my @segments = (