diff --git a/src/Hydra/lib/Hydra/Controller/Root.pm b/src/Hydra/lib/Hydra/Controller/Root.pm index cd903dd3..72673564 100644 --- a/src/Hydra/lib/Hydra/Controller/Root.pm +++ b/src/Hydra/lib/Hydra/Controller/Root.pm @@ -118,7 +118,7 @@ sub queue :Local { } -sub showJobStatus :Local { +sub showJobStatus { my ($c, $builds) = @_; $c->stash->{template} = 'jobstatus.tt'; @@ -683,20 +683,18 @@ sub download :Local { sub closure :Local { - my ($self, $c, $buildId, $productnr) = @_; + my ($self, $c, $buildId) = @_; my $build = getBuild($c, $buildId); - return error($c, "Build with ID $buildId doesn't exist.") if !defined $build; + return error($c, "Build $buildId doesn't exist.") if !defined $build; - my $product = $build->buildproducts->find({productnr => $productnr}); - return error($c, "Build $buildId doesn't have a product $productnr.") if !defined $product; + return error($c, "Build $buildId cannot be downloaded as a closure.") + if !$build->buildproducts->find({type => "nix-build"}); - return error($c, "Product is not a Nix build.") if $product->type ne "nix-build"; - - return error($c, "Path " . $product->path . " is no longer available.") unless isValidPath($product->path); + return error($c, "Path " . $build->outpath . " is no longer available.") unless isValidPath($build->outpath); $c->stash->{current_view} = 'Hydra::View::NixClosure'; - $c->stash->{storePath} = $product->path; + $c->stash->{storePath} = $build->outpath; $c->stash->{name} = $build->nixname; # !!! quick hack; this is to make HEAD requests return the right diff --git a/src/Hydra/root/product-list.tt b/src/Hydra/root/product-list.tt index 89227424..f86ea0fe 100644 --- a/src/Hydra/root/product-list.tt +++ b/src/Hydra/root/product-list.tt @@ -9,7 +9,7 @@ [% SWITCH product.type %] [% CASE "nix-build" %] - + Nix build of path [% product.path %] @@ -23,7 +23,7 @@ or to download and unpack in one command: -
$ curl [% c.uri_for('/closure' build.id product.productnr) %] | gunzip | nix-store --import+
$ curl [% c.uri_for('/closure' build.id) %] | gunzip | nix-store --import
The package can then be found in the path [% product.path %]. You’ll probably also want to do