From 5f8dcab85411d408809a4ef038264338543143b1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Feb 2009 09:34:29 +0000 Subject: [PATCH] * Closure downloads: don't include the product number; it's not needed. --- src/Hydra/lib/Hydra/Controller/Root.pm | 16 +++++++--------- src/Hydra/root/product-list.tt | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) 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" %] - + Source 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