Skip to content

Commit

Permalink
Merge pull request #830 from ugexe/patch-8
Browse files Browse the repository at this point in the history
Return InstalledDistribution where appropriate
  • Loading branch information
niner committed Jul 24, 2016
2 parents 32c08b1 + ccf2dfc commit f1f750d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core/CompUnit/Repository/Installation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,7 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
{
my ($dist-id, $dist) = self!matching-dist($spec);
if $dist-id {
my $loader = $.prefix.child('sources').child(
$dist<provides>{$spec.short-name}.values[0]<file>
);
my $id = $loader.basename;
my $id = $dist<provides>{$spec.short-name}.values[0]<file>;

# xxx: replace :distribution with meta6
return CompUnit.new(
Expand All @@ -462,7 +459,7 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
:auth($dist<auth> // Str),
:repo(self),
:repo-id($id),
:distribution(Distribution::Hash.new($dist.hash, :$.prefix)),
:distribution(InstalledDistribution.new($dist.hash, :$.prefix)),
);
}
return self.next-repo.resolve($spec) if self.next-repo;
Expand Down Expand Up @@ -506,7 +503,7 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
:repo(self),
:repo-id($id),
:$precompiled,
:distribution(Distribution::Hash.new($dist.hash, :$.prefix)),
:distribution(InstalledDistribution.new($dist.hash, :$.prefix)),
);
return %!loaded{$compunit.short-name} = $compunit;
}
Expand Down

0 comments on commit f1f750d

Please sign in to comment.