Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Delegate to next-repo if we find no candiate for a module
  • Loading branch information
niner committed Oct 24, 2015
1 parent 9e8ffaa commit 278913e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/core/CompUnit/DependencySpecification.pm
Expand Up @@ -3,6 +3,10 @@ class CompUnit::DependencySpecification {
has $.version-matcher = True;
has $.auth-matcher = True;
has $.api-matcher = True;

method Str(CompUnit::DependencySpecification:D:) {
return "{$.short-name}:ver<{$.version-matcher}>:auth<{$.auth-matcher}>:api<{$.api-matcher}>";
}
}

# vim: ft=perl6 expandtab sw=4
7 changes: 6 additions & 1 deletion src/core/CompUnitRepo/Locally.pm
Expand Up @@ -36,10 +36,15 @@ role CompUnitRepo::Locally {
CompUnit::PrecompilationRepository $precomp = self.precomp-repository())
returns CompUnit:D
{
self.candidates($spec.short-name, :auth($spec.auth-matcher), :ver($spec.version-matcher))[0];
my @candidates = self.candidates($spec.short-name, :auth($spec.auth-matcher), :ver($spec.version-matcher));
return @candidates[0] if @candidates;
return self.next-repo.need($spec, $precomp) if self.next-repo;
nqp::die("Could not find $spec in $.Str");
}

method loaded() returns Iterable {
return ();
}
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit 278913e

Please sign in to comment.