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-Tag: v0.003001_01~48 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ab6f7e2d16c420fd1837dde6c69e1e8ef47f3f3;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 76e40c2..734929b 100644 --- a/lib/Object/Remote/FatNode.pm +++ b/lib/Object/Remote/FatNode.pm @@ -140,8 +140,11 @@ sub generate_fatpack_hash { (my $stub = $orig) =~ s/\.pm$//; my $name = uc join '_', split '/', $stub; my $data = $files{$orig} or die $orig; $data =~ s/^/ /mg; - 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 = (