diff options
author | Shea Levy <shea@shealevy.com> | 2012-03-29T16·20+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-04-13T12·29+0200 |
commit | 055e803851e73bb94d341c3b4f25f52be167fef7 (patch) | |
tree | 00912107a6f74b6f3f0c8effef6754708768c974 /perl | |
parent | 00c98a6befb70228c7ba2b7d5dc8684289915baa (diff) |
Add the '--show-progress' flag to nix-copy-closure
Diffstat (limited to 'perl')
-rw-r--r-- | perl/lib/Nix/CopyClosure.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index 08573b2ab1f1..4794fed9d006 100644 --- a/perl/lib/Nix/CopyClosure.pm +++ b/perl/lib/Nix/CopyClosure.pm @@ -6,11 +6,12 @@ use Nix::Store; sub copyTo { - my ($sshHost, $sshOpts, $storePaths, $compressor, $decompressor, $includeOutputs, $dryRun, $sign) = @_; + my ($sshHost, $sshOpts, $storePaths, $compressor, $decompressor, $includeOutputs, $dryRun, $sign, $progressViewer) = @_; $compressor = "$compressor |" if $compressor ne ""; $decompressor = "$decompressor |" if $decompressor ne ""; - + $progressViewer = "$progressViewer |" if $progressViewer ne ""; + # Get the closure of this path. my @closure = reverse(topoSortPaths(computeFSClosure(0, $includeOutputs, map { followLinksToStorePath $_ } @{$storePaths}))); @@ -34,7 +35,7 @@ sub copyTo { if (scalar @missing > 0) { print STDERR "copying ", scalar @missing, " missing paths to ‘$sshHost’...\n"; unless ($dryRun) { - open SSH, "| $compressor ssh $sshHost @{$sshOpts} '$decompressor nix-store --import' > /dev/null" or die; + open SSH, "| $progressViewer $compressor ssh $sshHost @{$sshOpts} '$decompressor nix-store --import' > /dev/null" or die; exportPaths(fileno(SSH), $sign, @missing); close SSH or die "copying store paths to remote machine `$sshHost' failed: $?"; } |