parent
7b351da680
commit
17ef234672
2 changed files with 8 additions and 4 deletions
|
@ -100,7 +100,7 @@ sub oldCopyTo {
|
||||||
|
|
||||||
# Optionally use substitutes on the remote host.
|
# Optionally use substitutes on the remote host.
|
||||||
if (!$dryRun && $useSubstitutes) {
|
if (!$dryRun && $useSubstitutes) {
|
||||||
system "ssh $sshHost @{$sshOpts} nix-store -r --ignore-unknown @closure";
|
system "ssh $sshHost @{$sshOpts} @globalSshOpts nix-store -r --ignore-unknown @closure";
|
||||||
# Ignore exit status because this is just an optimisation.
|
# Ignore exit status because this is just an optimisation.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ sub oldCopyTo {
|
||||||
my $missingSize = 0;
|
my $missingSize = 0;
|
||||||
while (scalar(@closure) > 0) {
|
while (scalar(@closure) > 0) {
|
||||||
my @ps = splice(@closure, 0, 1500);
|
my @ps = splice(@closure, 0, 1500);
|
||||||
open(READ, "set -f; ssh $sshHost @{$sshOpts} nix-store --check-validity --print-invalid @ps|");
|
open(READ, "set -f; ssh $sshHost @{$sshOpts} @globalSshOpts nix-store --check-validity --print-invalid @ps|");
|
||||||
while (<READ>) {
|
while (<READ>) {
|
||||||
chomp;
|
chomp;
|
||||||
push @missing, $_;
|
push @missing, $_;
|
||||||
|
@ -130,7 +130,7 @@ sub oldCopyTo {
|
||||||
if (scalar @missing > 0) {
|
if (scalar @missing > 0) {
|
||||||
print STDERR "copying ", scalar @missing, " missing paths to ‘$sshHost’...\n";
|
print STDERR "copying ", scalar @missing, " missing paths to ‘$sshHost’...\n";
|
||||||
unless ($dryRun) {
|
unless ($dryRun) {
|
||||||
open SSH, "| $progressViewer $compressor ssh $sshHost @{$sshOpts} '$decompressor nix-store --import' > /dev/null" or die;
|
open SSH, "| $progressViewer $compressor ssh $sshHost @{$sshOpts} @globalSshOpts '$decompressor nix-store --import' > /dev/null" or die;
|
||||||
exportPaths(fileno(SSH), $sign, @missing);
|
exportPaths(fileno(SSH), $sign, @missing);
|
||||||
close SSH or die "copying store paths to remote machine `$sshHost' failed: $?";
|
close SSH or die "copying store paths to remote machine `$sshHost' failed: $?";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,16 @@ use IPC::Open2;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(
|
our @EXPORT = qw(
|
||||||
|
@globalSshOpts
|
||||||
readN readInt readString readStrings
|
readN readInt readString readStrings
|
||||||
writeInt writeString writeStrings
|
writeInt writeString writeStrings
|
||||||
connectToRemoteNix
|
connectToRemoteNix
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
our @globalSshOpts = split ' ', ($ENV{"NIX_SSHOPTS"} or "");
|
||||||
|
|
||||||
|
|
||||||
sub readN {
|
sub readN {
|
||||||
my ($bytes, $from) = @_;
|
my ($bytes, $from) = @_;
|
||||||
my $res = "";
|
my $res = "";
|
||||||
|
@ -82,7 +86,7 @@ sub connectToRemoteNix {
|
||||||
# Start ‘nix-store --serve’ on the remote host.
|
# Start ‘nix-store --serve’ on the remote host.
|
||||||
my ($from, $to);
|
my ($from, $to);
|
||||||
# FIXME: don't start a shell, start ssh directly.
|
# FIXME: don't start a shell, start ssh directly.
|
||||||
my $pid = open2($from, $to, "exec ssh -x -a $sshHost @{$sshOpts} nix-store --serve --write $extraFlags");
|
my $pid = open2($from, $to, "exec ssh -x -a $sshHost @globalSshOpts @{$sshOpts} nix-store --serve --write $extraFlags");
|
||||||
|
|
||||||
# Do the handshake.
|
# Do the handshake.
|
||||||
my $SERVE_MAGIC_1 = 0x390c9deb; # FIXME
|
my $SERVE_MAGIC_1 = 0x390c9deb; # FIXME
|
||||||
|
|
Loading…
Reference in a new issue