* Allow downloading of build products.
This commit is contained in:
parent
25f227f678
commit
f9c0996003
|
@ -162,6 +162,21 @@ sub loadLog {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub download :Local {
|
||||||
|
my ( $self, $c, $id, $productnr, $filename ) = @_;
|
||||||
|
|
||||||
|
my $build = getBuild($c, $id);
|
||||||
|
return error($c, "Build with ID $id doesn't exist.") if !defined $build;
|
||||||
|
|
||||||
|
my $product = $build->buildproducts->find({productnr => $productnr});
|
||||||
|
return error($c, "Build $id doesn't have a product $productnr.") if !defined $product;
|
||||||
|
|
||||||
|
return error($c, "File " . $product->path . " has disappeared.") unless -e $product->path;
|
||||||
|
|
||||||
|
$c->serve_static_file($product->path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub end : ActionClass('RenderView') {}
|
sub end : ActionClass('RenderView') {}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -197,14 +197,16 @@
|
||||||
[% CASE "nix-build" %]
|
[% CASE "nix-build" %]
|
||||||
Nix build of path <tt>[% product.path %]</tt>
|
Nix build of path <tt>[% product.path %]</tt>
|
||||||
[% CASE "file" %]
|
[% CASE "file" %]
|
||||||
[% SWITCH product.subtype %]
|
<a href="[% c.uri_for('/download' build.id product.productnr product.name) %]">
|
||||||
[% CASE "source-dist" %]
|
[% SWITCH product.subtype %]
|
||||||
<img src="/static/images/source-dist.png" alt="Source" /> Source distribution <tt>[% product.name %]</tt>
|
[% CASE "source-dist" %]
|
||||||
[% CASE "rpm" %]
|
<img src="/static/images/source-dist.png" alt="Source" /> Source distribution <tt>[% product.name %]</tt>
|
||||||
<img src="/static/images/rpm-fedora.png" alt="RPM" /> RPM package <tt>[% product.name %]</tt>
|
[% CASE "rpm" %]
|
||||||
[% CASE DEFAULT %]
|
<img src="/static/images/rpm-fedora.png" alt="RPM" /> RPM package <tt>[% product.name %]</tt>
|
||||||
File <tt>[% product.path %]</tt> of type <tt>[% product.subtype %]</tt>
|
[% CASE DEFAULT %]
|
||||||
[% END %]
|
File <tt>[% product.name %]</tt> of type <tt>[% product.subtype %]</tt>
|
||||||
|
[% END %]
|
||||||
|
</a>
|
||||||
[<a href="javascript:" onclick="javascript:$('#foo-[% product.productnr %]').toggle()">details</a>]
|
[<a href="javascript:" onclick="javascript:$('#foo-[% product.productnr %]').toggle()">details</a>]
|
||||||
<div class="productDetails" id="foo-[% product.productnr %]">
|
<div class="productDetails" id="foo-[% product.productnr %]">
|
||||||
<table>
|
<table>
|
||||||
|
|
Loading…
Reference in a new issue