From 1a44f1cb656557715d328818270b82c0c13d58a0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Jul 2014 17:11:54 +0200 Subject: nix-copy-closure: Drop --bzip2, --xz, --show-progress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are too difficult to implement via nix-store --serve. ‘--show-progress’ could be re-implemented fairly easily via a sink/source wrapper class. --- perl/lib/Nix/CopyClosure.pm | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'perl') diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index e12fef6bb731..d707158b568b 100644 --- a/perl/lib/Nix/CopyClosure.pm +++ b/perl/lib/Nix/CopyClosure.pm @@ -9,8 +9,7 @@ use IPC::Open2; sub copyToOpen { - my ($from, $to, $sshHost, $storePaths, $compressor, $decompressor, - $includeOutputs, $dryRun, $sign, $progressViewer, $useSubstitutes) = @_; + my ($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_; $useSubstitutes = 0 if $dryRun || !defined $useSubstitutes; @@ -41,34 +40,13 @@ sub copyToOpen { # Send the "import paths" command. syswrite($to, pack("L&" . fileno($to), $to_, - $progressViewer && $compressor ? "$progressViewer | $compressor" : $progressViewer || $compressor); - close $to; - exportPaths(fileno($to_), $sign, @missing); - close $to_; - waitpid $pid2, 0; - - } else { - exportPaths(fileno($to), $sign, @missing); - } - + exportPaths(fileno($to), $sign, @missing); readInt($from) == 1 or die "remote machine \`$sshHost' failed to import closure\n"; } sub copyTo { - my ($sshHost, $sshOpts, $storePaths, $compressor, $decompressor, - $includeOutputs, $dryRun, $sign, $progressViewer, $useSubstitutes) = @_; + my ($sshHost, $sshOpts, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_; # Connect to the remote host. my ($from, $to); @@ -81,8 +59,7 @@ sub copyTo { return oldCopyTo(@_); } - copyToOpen($from, $to, $sshHost, $storePaths, $compressor, $decompressor, - $includeOutputs, $dryRun, $sign, $progressViewer, $useSubstitutes); + copyToOpen($from, $to, $sshHost, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes); close $to; } @@ -91,8 +68,7 @@ sub copyTo { # For backwards compatibility with Nix <= 1.7. Will be removed # eventually. sub oldCopyTo { - my ($sshHost, $sshOpts, $storePaths, $compressor, $decompressor, - $includeOutputs, $dryRun, $sign, $progressViewer, $useSubstitutes) = @_; + my ($sshHost, $sshOpts, $storePaths, $includeOutputs, $dryRun, $sign, $useSubstitutes) = @_; # Get the closure of this path. my @closure = reverse(topoSortPaths(computeFSClosure(0, $includeOutputs, @@ -122,15 +98,12 @@ sub oldCopyTo { close READ or die; } - $compressor = "$compressor |" if $compressor ne ""; - $decompressor = "$decompressor |" if $decompressor ne ""; - $progressViewer = "$progressViewer -s $missingSize |" if $progressViewer ne ""; - # Export the store paths and import them on the remote machine. if (scalar @missing > 0) { print STDERR "copying ", scalar @missing, " missing paths to ‘$sshHost’...\n"; + print STDERR "@missing\n"; unless ($dryRun) { - open SSH, "| $progressViewer $compressor ssh $sshHost @{$sshOpts} @globalSshOpts '$decompressor nix-store --import' > /dev/null" or die; + open SSH, "| ssh $sshHost @{$sshOpts} @globalSshOpts 'nix-store --import' > /dev/null" or die; exportPaths(fileno(SSH), $sign, @missing); close SSH or die "copying store paths to remote machine `$sshHost' failed: $?"; } -- cgit 1.4.1