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 "s3-binary-cache" ? "https://" . $c->config->{binary_cache_s3_bucket} . ".s3.amazonaws.com/" :
die;
my $args =
defined $c->config->{binary_cache_public_key_file}
? "--option binary-cache-public-keys " . read_file($c->config->{binary_cache_public_key_file}) . "\n"
: "";
my $args = "";
if (defined $c->config->{binary_cache_public_key_file}
&& -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");
}