Add an action to download a specific output of a build as a .nar.bz2

[?]
Aug 21, 2013, 12:30 PM
45A23NZPOQOJD4R45FPVPJR3642OCVIJHBA4RBQ3IB7JAQ2FGI4QC

Dependencies

  • [2] XJFHFZCA * Provide some redirects to build products by type so that we can for
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.

Change contents

  • edit in src/lib/Hydra/Controller/Build.pm at line 246
    [2.776]
    [2.776]
  • edit in src/lib/Hydra/Controller/Build.pm at line 248
    [2.777]
    [2.777]
    sub output : Chained('buildChain') PathPart Args(1) {
    my ($self, $c, $outputName) = @_;
    my $build = $c->stash->{build};
  • edit in src/lib/Hydra/Controller/Build.pm at line 252
    [2.778]
    [2.778]
    error($c, "This build is not finished yet.") unless $build->finished;
    my $output = $build->buildoutputs->find({name => $outputName});
    notFound($c, "This build has no output named ‘$outputName’") unless defined $output;
    error($c, "Output is not available.") unless isValidPath $output->path;
    $c->response->header('Content-Disposition', "attachment; filename=\"build-${\$build->id}-${\$outputName}.nar.bz2\"");
    $c->stash->{current_view} = 'NixNAR';
    $c->stash->{storePath} = $output->path;
    }