hydra-server: Don't barf if the binary cache public key can't be read

This commit is contained in:
Eelco Dolstra 2016-02-26 21:14:40 +01:00
parent 53ca41ef9f
commit e8cdfe5171

View file

@ -239,10 +239,12 @@ sub download : Chained('buildChain') PathPart {
$storeMode eq "local-binary-cache" ? "file://" . $c->config->{binary_cache_dir} : $storeMode eq "local-binary-cache" ? "file://" . $c->config->{binary_cache_dir} :
$storeMode eq "s3-binary-cache" ? "https://" . $c->config->{binary_cache_s3_bucket} . ".s3.amazonaws.com/" : $storeMode eq "s3-binary-cache" ? "https://" . $c->config->{binary_cache_s3_bucket} . ".s3.amazonaws.com/" :
die; die;
my $args = my $args = "";
defined $c->config->{binary_cache_public_key_file} if (defined $c->config->{binary_cache_public_key_file}
? "--option binary-cache-public-keys " . read_file($c->config->{binary_cache_public_key_file}) . "\n" && -r $c->config->{binary_cache_public_key_file})
: ""; {
$args = "--option binary-cache-public-keys " . read_file($c->config->{binary_cache_public_key_file});
}
system("nix-store --realise '$storePath' --option extra-binary-caches '$url' $args>/dev/null"); system("nix-store --realise '$storePath' --option extra-binary-caches '$url' $args>/dev/null");
} }