From e8cdfe5171872e73471de73494941117604d9611 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 26 Feb 2016 21:14:40 +0100 Subject: [PATCH] hydra-server: Don't barf if the binary cache public key can't be read --- src/lib/Hydra/Controller/Build.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 23535922..cdf68456 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -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"); }