* Support serving products that are directories (such as manuals or
[?]
Nov 12, 2008, 3:36 PM
MOCEUXZAS4CNZL2QDKGVTZCRZ6AMOO2WSFHJ4VPZPPPAXHANG4NACDependencies
- [2]
L5VIEXSC* Allow downloading of build products. - [3]
B72GLND4 - [4]
UVMFS73T* Some jQuery / CSS hackery. - [5]
J5UVLXOK* Start of a basic Catalyst web interface. - [6]
DVNWJXWW* Generic declaration of build products. - [7]
K5BEBWKM - [8]
7YBYT2LQ
Change contents
- replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 166
my ( $self, $c, $id, $productnr, $filename ) = @_;my ( $self, $c, $id, $productnr, $filename, @path ) = @_; - replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 174
return error($c, "File " . $product->path . " has disappeared.") unless -e $product->path;return error($c, "Product " . $product->path . " has disappeared.") unless -e $product->path; - replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 176
$c->serve_static_file($product->path);# Security paranoia.foreach my $elem (@path) {if ($elem eq "." || $elem eq ".." || $elem !~ /^[\w\-\.]+$/) {return error($c, "Invalid filename $elem.");}}my $path = $product->path . "/" . join("/", @path);# If this is a directory but no "/" is attached, then redirect.if (-d $path && substr($c->request->uri, -1) ne "/") {return $c->res->redirect($c->request->uri . "/");}$path = "$path/index.html" if -d $path && -e "$path/index.html";if (!-e $path) {return error($c, "File $path does not exist.");}$c->serve_static_file($path); - edit in src/HydraFrontend/root/build.tt at line 197
- edit in src/HydraFrontend/root/build.tt at line 200
- edit in src/HydraFrontend/root/build.tt at line 229
[% CASE "report" %]<a href="[% c.uri_for('/download' build.id product.productnr product.name) %]">[% SWITCH product.subtype %][% CASE "coverage" %]Code coverage analysis report[% CASE DEFAULT %]Report of type <tt>[% product.subtype %]</tt>[% END %]</a> - edit in src/HydraFrontend/root/build.tt at line 243
- edit in src/HydraFrontend/root/hydra.css at line 181
- edit in src/HydraFrontend/root/hydra.css at line 182
- replacement in src/build.pl at line 224
my $st = stat($path) or die "cannot stat $path: $!";my $fileSize, my $sha1, my $sha256; - replacement in src/build.pl at line 226
my $sha1 = `nix-hash --flat --type sha1 $path`or die "cannot hash $path: $?";;chomp $sha1;if (-f $path) {my $st = stat($path) or die "cannot stat $path: $!";$fileSize = $st;$sha1 = `nix-hash --flat --type sha1 $path`or die "cannot hash $path: $?";;chomp $sha1; - replacement in src/build.pl at line 234
my $sha256 = `nix-hash --flat --type sha256 $path`or die "cannot hash $path: $?";;chomp $sha256;$sha256 = `nix-hash --flat --type sha256 $path`or die "cannot hash $path: $?";;chomp $sha256;} - replacement in src/build.pl at line 245
, filesize => $st->size, filesize => $fileSize