This commit is contained in:
Eelco Dolstra 2009-02-25 14:50:17 +00:00
parent 76c3ae1cef
commit ed1668704e
3 changed files with 16 additions and 13 deletions

View file

@ -21,6 +21,21 @@ sub closure : Chained('nix') PathPart {
sub manifest : Chained('nix') PathPart Args(0) {
my ($self, $c) = @_;
$c->stash->{current_view} = 'Hydra::View::NixManifest';
$c->stash->{narBase} = $c->uri_for($self->action_for("nar"), $c->req->captures);
}
sub nar : Chained('nix') PathPart {
my ($self, $c, @rest) = @_;
my $path .= "/" . join("/", @rest);
error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
# !!! check that $path is in the closure of $c->stash->{storePaths}.
$c->stash->{current_view} = 'Hydra::View::NixNAR';
$c->stash->{storePath} = $path;
}

View file

@ -562,18 +562,6 @@ sub nixpkg :Local {
}
sub nar :Local {
my ($self, $c, @rest) = @_;
my $path .= "/" . join("/", @rest);
error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
$c->stash->{current_view} = 'Hydra::View::NixNAR';
$c->stash->{storePath} = $path;
}
sub end : ActionClass('RenderView') {
my ($self, $c) = @_;

View file

@ -37,7 +37,7 @@ sub process {
or die "cannot query hash of `$path': $?";
chomp $hash;
my $url = $c->uri_for('/nar' . $path);
my $url = $c->stash->{narBase} . $path;
my $deriver = `nix-store --query --deriver $path`
or die "cannot query deriver of `$path': $?";