diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index 5085ec07..53da7203 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