Skip to content

Commit

Permalink
Only slurp source file once during install
Browse files Browse the repository at this point in the history
  • Loading branch information
ugexe committed Jun 17, 2017
1 parent c532b79 commit 5755338
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/CompUnit/Repository/Installation.pm
Expand Up @@ -260,16 +260,16 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
my $id = self!file-id(~$name, $dist-id);
my $destination = $sources-dir.add($id);
my $handle = $dist.content($file);
self!add-short-name($name, $dist, $id, nqp::sha1($handle.open(:enc<iso-8859-1>).slurp(:close)));
my $content = $handle.open(:bin).slurp(:close);

self!add-short-name($name, $dist, $id, nqp::sha1($content.decode('iso-8859-1')));
%provides{ $name } = ~$file => {
:file($id),
:time(try $file.IO.modified.Num),
:$!cver
};
note("Installing {$name} for {$dist.meta<name>}") if $verbose and $name ne $dist.meta<name>;
my $content = $handle.open.slurp-rest(:bin,:close);
$destination.spurt($content);
$handle.close;
}

# bin/ scripts
Expand Down

0 comments on commit 5755338

Please sign in to comment.