From 22144afa8d9f8968da351618a1347072a93bd8aa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Jun 2013 11:55:15 +0200 Subject: Don't keep "disabled" substituters running For instance, it's pointless to keep copy-from-other-stores running if there are no other stores, or download-using-manifests if there are no manifests. This also speeds things up because we don't send queries to those substituters. --- perl/lib/Nix/Manifest.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perl') diff --git a/perl/lib/Nix/Manifest.pm b/perl/lib/Nix/Manifest.pm index ed43900b5c53..50e354c0c5bd 100644 --- a/perl/lib/Nix/Manifest.pm +++ b/perl/lib/Nix/Manifest.pm @@ -227,6 +227,9 @@ sub writeManifest { sub updateManifestDB { my $manifestDir = $Nix::Config::manifestDir; + my @manifests = glob "$manifestDir/*.nixmanifest"; + return undef if scalar @manifests == 0; + mkpath($manifestDir); unlink "$manifestDir/cache.sqlite"; # remove obsolete cache @@ -311,7 +314,7 @@ EOF # unless we've already done so on a previous run. my %seen; - for my $manifestLink (glob "$manifestDir/*.nixmanifest") { + for my $manifestLink (@manifests) { my $manifest = Cwd::abs_path($manifestLink); next unless -f $manifest; my $timestamp = lstat($manifest)->mtime; -- cgit 1.4.1