[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
44/118: nix-copy-closure: Fix --dry-run
From: |
Ludovic Courtès |
Subject: |
44/118: nix-copy-closure: Fix --dry-run |
Date: |
Tue, 19 May 2015 14:45:33 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 7c3a5090bff4e9cfe70f1d89619563b55af13d89
Author: Eelco Dolstra <address@hidden>
Date: Thu Jul 10 17:44:18 2014 +0200
nix-copy-closure: Fix --dry-run
---
perl/lib/Nix/CopyClosure.pm | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm
index 5085ec0..53da720 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 address@hidden;
+ 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<x4", 4)) or die;
writeString($compressor, $to);
@@ -85,11 +92,7 @@ sub copyTo {
if ($compressor || $progressViewer) {
# Compute the size of the closure for the progress viewer.
- if ($progressViewer) {
- my $missingSize = 0;
- $missingSize += (queryPathInfo($_, 1))[3] foreach @missing;
- $progressViewer = "$progressViewer -s $missingSize";
- }
+ $progressViewer = "$progressViewer -s $missingSize" if $progressViewer;
# Start the compressor and/or progress viewer in between us
# and the remote host.
@@ -107,9 +110,6 @@ sub copyTo {
}
readInt($from) == 1 or die "remote machine \`$sshHost' failed to import
closure\n";
-
- # Shut down the server process.
- waitpid $pid, 0;
}
- 36/118: Fix compilation error on some versions of GCC, (continued)
- 36/118: Fix compilation error on some versions of GCC, Ludovic Courtès, 2015/05/19
- 32/118: Style fix, Ludovic Courtès, 2015/05/19
- 46/118: Fix use of sysread, Ludovic Courtès, 2015/05/19
- 33/118: Manual: html -> xhtml, Ludovic Courtès, 2015/05/19
- 45/118: nix-copy-closure -s: Do substitutions via ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 40/118: Remove maybeVfork, Ludovic Courtès, 2015/05/19
- 50/118: Fix closure size display, Ludovic Courtès, 2015/05/19
- 38/118: Fix security hole in ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 43/118: Remove tabs, Ludovic Courtès, 2015/05/19
- 35/118: Don't build on Ubuntu 10.10, Ludovic Courtès, 2015/05/19
- 44/118: nix-copy-closure: Fix --dry-run,
Ludovic Courtès <=
- 47/118: Replace message "importing path <...>" with "exporting path <...>", Ludovic Courtès, 2015/05/19
- 37/118: Add a test for the SSH substituter, Ludovic Courtès, 2015/05/19
- 39/118: nix-copy-closure: Fix race condition, Ludovic Courtès, 2015/05/19
- 49/118: Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory, Ludovic Courtès, 2015/05/19
- 52/118: Fix test, Ludovic Courtès, 2015/05/19
- 42/118: Refactoring: Move all fork handling into a higher-order function, Ludovic Courtès, 2015/05/19
- 41/118: nix-copy-closure: Restore compression and the progress viewer, Ludovic Courtès, 2015/05/19
- 54/118: build-remote.pl: Don't keep a shell process around, Ludovic Courtès, 2015/05/19
- 57/118: Manual: Typo, Ludovic Courtès, 2015/05/19
- 53/118: build-remote.pl: Fix build log, Ludovic Courtès, 2015/05/19