Speed up channel processing

In particular the /pkg action is now O(lg n) instead of O(n) in the
number of packages in the channel, and listing the channel contents
no longer requires calling isValidPath() on all packages.

Derivations (and thus build time dependencies) are no longer included
in the channel, because they're not GC roots.  Thus they could
disappear unexpectedly.
This commit is contained in:
Eelco Dolstra
2012-03-08 01:17:59 +01:00
parent 9f10c0f9c0
commit 2d1cf73974
4 changed files with 50 additions and 45 deletions

View File

@ -370,10 +370,7 @@ sub nix : Chained('build') PathPart('nix') CaptureArgs(0) {
notFound($c, "Path " . $build->outpath . " is no longer available.")
unless isValidPath($build->outpath);
$c->stash->{storePaths} = [$build->outpath];
my $pkgName = $build->nixname . "-" . $build->system;
$c->stash->{nixPkgs} = {"${pkgName}.nixpkg" => {build => $build, name => $pkgName}};
$c->stash->{channelBuilds} = $c->model('DB::Builds')->search({id => $build->id});
}