From 7c3a5090bff4e9cfe70f1d89619563b55af13d89 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Jul 2014 17:44:18 +0200 Subject: nix-copy-closure: Fix --dry-run --- perl/lib/Nix/CopyClosure.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'perl') diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index 5085ec075b96..53da72038d64 100644 --- a/perl/lib/Nix/CopyClosure.pm +++ b/perl/lib/Nix/CopyClosure.pm @@ -78,6 +78,13 @@ sub copyTo { my @missing = grep { !$present{$_} } @closure; return if !@missing; + my $missingSize = 0; + $missingSize += (queryPathInfo($_, 1))[3] foreach @missing; + + printf STDERR "copying %d missing paths (%.2f MiB) to ‘$sshHost’...\n", + scalar(@missing), $missingSize / (1024.0^2); + return if $dryRun; + # Send the "import paths" command. syswrite($to, pack("L