summary refs log tree commit diff
path: root/perl/lib/Nix/CopyClosure.pm
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2012-03-29 18:20:31 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-04-13 14:29:12 +0200
commit055e803851e73bb94d341c3b4f25f52be167fef7 (patch)
tree00912107a6f74b6f3f0c8effef6754708768c974 /perl/lib/Nix/CopyClosure.pm
parent00c98a6befb70228c7ba2b7d5dc8684289915baa (diff)
downloadguix-055e803851e73bb94d341c3b4f25f52be167fef7.tar.gz
Add the '--show-progress' flag to nix-copy-closure
Diffstat (limited to 'perl/lib/Nix/CopyClosure.pm')
-rw-r--r--perl/lib/Nix/CopyClosure.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm
index 08573b2ab1..4794fed9d0 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: $?";
         }