/
product-list.tt
174 lines (135 loc) · 5.94 KB
/
product-list.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
[% USE mibs=format("%.2f") %]
[% BLOCK renderProductList -%]
<ul class="productList">
[% FOREACH product IN build.buildproducts -%]
[% uri = "${c.uri_for('/build' build.id 'download' product.productnr)}"
_ (product.name ? "/" _ product.name : "")
_ (product.defaultpath ? "/" _ product.defaultpath : "") %]
[% contents = c.uri_for('/build' build.id 'contents' product.productnr) %]
[% SWITCH product.type %]
[% CASE "nix-build" %]
<li class="product">
[% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %]
<a href="[% uri %]">
<img src="/static/images/nix-build.png" alt="Source" />
One-click install of Nix package <tt>[% build.nixname %]</tt>
</a>
[<a class="productDetailsToggle" href="javascript:">help</a>, <a href="[% contents %]">contents</a>]
<div class="help productDetails">
<p>If you have Nix installed on your machine, you can
install this package and all its dependencies automatically
by clicking on the link above. This requires that you have
the <tt>application/nix-package</tt> MIME type associated
with the <tt>nix-install-package</tt> program in your web
browser. Alternatively, you can install it from the
command-line:</p>
<pre>$ nix-install-package --non-interactive --url [% uri %]</pre>
<p>If you get an error message “Permission denied”, you
should make sure that you have sufficient access rights to
the Nix store, e.g., run the command as <tt>root</tt>.
</p>
</div>
</li>
<li class="product">
[% filename = "${build.nixname}.closure.gz" %]
[% uri = c.uri_for('/build' build.id 'nix' 'closure' filename ) %]
<a href="[% uri %]">
<img src="/static/images/nix-build.png" alt="Source" />
Nix closure of path <tt>[% product.path %]</tt>
</a>
[<a class="productDetailsToggle" href="javascript:">help</a>]
<div class="help productDetails">
<p>If you have Nix installed on your machine, this build and
all its dependencies can be unpacked into your local Nix
store by doing:</p>
<pre>$ gunzip < [% filename %] | nix-store --import</pre>
<p>or to download and unpack in one command:</p>
<pre>$ curl [% uri %] | gunzip | nix-store --import</pre>
<p>The package can then be found in the path <tt>[%
product.path %]</tt>. You’ll probably also want to do</p>
<pre>$ nix-env -i [% product.path %]</pre>
<p>to actually install the package in your Nix user environment.</p>
<p>If you get the error message “imported
archive lacks a signature”, you should make sure that you have
sufficient access rights to the Nix store, e.g., run the
command as <tt>root</tt>.</p>
</div>
</li>
[% CASE "file" %]
<li class="product">
<a href="[% uri %]">
[% SWITCH product.subtype %]
[% CASE "source-dist" %]
<img src="/static/images/source-dist.png" alt="Source" /> Source distribution <tt>[% product.name %]</tt>
[% CASE "rpm" %]
<img src="/static/images/rpm.png" alt="RPM" /> RPM package <tt>[% product.name %]</tt>
[% CASE "deb" %]
<img src="/static/images/debian.png" alt="RPM" /> Debian package <tt>[% product.name %]</tt>
[% CASE "iso" %]
<img src="/static/images/iso.png" alt="ISO" /> ISO-9660 CD/DVD image <tt>[% product.name %]</tt>
[% CASE DEFAULT %]
File <tt>[% product.name %]</tt> of type <tt>[% product.subtype %]</tt>
[% END %]
</a>
[<a class="productDetailsToggle" href="javascript:">details</a>, <a href="[% contents %]">contents</a>]
<div class="productDetails">
<table>
<tr>
<th>URL:</th>
<td>
<a href="[% uri %]">
<tt>[% uri %]</tt>
</a>
</td>
</tr>
<tr><th>File size:</th><td>[% product.filesize %] bytes ([% mibs(product.filesize / (1024 * 1024)) %] MiB)</td></tr>
<tr><th>SHA-1 hash:</th><td><tt>[% product.sha1hash %]</tt></td></tr>
<tr><th>SHA-256 hash:</th><td><tt>[% product.sha256hash %]</tt></td></tr>
<tr><th>Full path:</th><td><tt>[% product.path %]</tt></td></tr>
</table>
</div>
</li>
[% CASE "report" %]
<li class="product">
<a href="[% uri %]">
<img src="/static/images/report.png" alt="Report" />
[% SWITCH product.subtype %]
[% CASE "coverage" %]
Code coverage analysis report
[% CASE DEFAULT %]
Report of type <tt>[% product.subtype %]</tt>
[% END %]
</a>
</li>
[% CASE "doc" %]
<li class="product">
<a href="[% uri %]">
<img src="/static/images/document.png" alt="Document" />
[% SWITCH product.subtype %]
[% CASE "readme" %]
“README” file
[% CASE "manual" %]
Manual
[% CASE "release-notes" %]
Release notes
[% CASE DEFAULT %]
Documentation of type <tt>[% product.subtype %]</tt>
[% END %]
</a>
</li>
[% CASE DEFAULT %]
<li class="product">
Something of type <tt>[% product.type %]</tt>
</li>
[% END %]
[% END -%]
</ul>
[% END %]
<script type="text/javascript">
$(document).ready(function() {
$('.productDetailsToggle').toggle(
function () { $(".productDetails", $(this).parents(".product")).fadeIn(); },
function () { $(".productDetails", $(this).parents(".product")).hide(); }
);
});
</script>