From: Tyler Riddle Date: Wed, 5 Dec 2012 19:12:51 +0000 (-0800) Subject: fix fatnode not parsing if included package did not end in new line X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb2b75a25feeac97cfba9bc3bb6c567433998c2c;p=scpubgit%2FObject-Remote.git fix fatnode not parsing if included package did not end in new line --- diff --git a/lib/Object/Remote/FatNode.pm b/lib/Object/Remote/FatNode.pm index bdf094b..8ce1d7d 100644 --- a/lib/Object/Remote/FatNode.pm +++ b/lib/Object/Remote/FatNode.pm @@ -160,8 +160,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 = (