-
-
Save ugexe/c31932c2c4b2e991c59a3a239f28d63c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @comp-units = ( | |
self!repository-version < 1 | |
?? $lookup.lines.unique.map({ | |
# Old, slower, repo format - must parse json meta data to determine name/auth/ver | |
my $dist = self.distribution($_); | |
CompUnit.new( | |
repo => self, | |
short-name => $spec.short-name, | |
auth => $dist.meta<auth>, | |
version => Version.new( $dist.meta<ver> || 0 ), | |
api => Version.new( $dist.meta<api> || 0 ), | |
repo-id => ( | |
$dist.meta<provides>{$spec.short-name}.values[0]<file> | |
|| $dist.meta<files>{$spec.short-name} | |
|| Any | |
), | |
distribution => $dist, | |
) | |
}) | |
!! $lookup.dir.map({ | |
# Faster repo format stores common data in a non-json format for quicker lookups | |
my ($ver, $auth, $api, $source, $checksum) = $_.slurp.split("\n"); | |
my $dist = self!lazy-distribution($_.basename); | |
CompUnit.new( | |
repo => self, | |
short-name => $spec.short-name, | |
auth => $auth, | |
version => Version.new( $ver || 0 ), | |
api => Version.new( $api || 0 ), | |
repo-id => $source, | |
distribution => $dist, | |
checksum => $checksum, | |
) | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment