about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--perl/Makefile.am2
-rw-r--r--perl/lib/Nix/SSH.pm (renamed from scripts/SSH.pm)0
-rw-r--r--scripts/Makefile.am2
-rwxr-xr-xscripts/build-remote.pl.in4
-rwxr-xr-xscripts/nix-copy-closure.in11
5 files changed, 8 insertions, 11 deletions
diff --git a/perl/Makefile.am b/perl/Makefile.am
index d41340af03eb..e6a5f9b5e71c 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -2,7 +2,7 @@ perlversion := $(shell perl -e 'use Config; print $$Config{version};')
 perlarchname := $(shell perl -e 'use Config; print $$Config{archname};')
 perllibdir = $(libdir)/perl5/site_perl/$(perlversion)/$(perlarchname)
 
-PERL_MODULES = lib/Nix/Store.pm lib/Nix/Manifest.pm lib/Nix/GeneratePatches.pm lib/Nix/Config.pm.in 
+PERL_MODULES = lib/Nix/Store.pm lib/Nix/Manifest.pm lib/Nix/GeneratePatches.pm lib/Nix/SSH.pm lib/Nix/Config.pm.in
 
 all: $(PERL_MODULES:.in=)
 
diff --git a/scripts/SSH.pm b/perl/lib/Nix/SSH.pm
index 68f4a628b072..68f4a628b072 100644
--- a/scripts/SSH.pm
+++ b/perl/lib/Nix/SSH.pm
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 5f80d351ac61..a5703760d1f7 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -13,7 +13,6 @@ install-exec-local: download-using-manifests.pl copy-from-other-stores.pl find-r
 	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/profile.d
 	$(INSTALL_PROGRAM) nix-profile.sh $(DESTDIR)$(sysconfdir)/profile.d/nix.sh
 	$(INSTALL) -d $(DESTDIR)$(libexecdir)/nix
-	$(INSTALL_DATA) SSH.pm $(DESTDIR)$(libexecdir)/nix 
 	$(INSTALL_PROGRAM) find-runtime-roots.pl $(DESTDIR)$(libexecdir)/nix 
 	$(INSTALL_PROGRAM) build-remote.pl $(DESTDIR)$(libexecdir)/nix 
 	$(INSTALL) -d $(DESTDIR)$(libexecdir)/nix/substituters
@@ -27,7 +26,6 @@ EXTRA_DIST = nix-collect-garbage.in \
   nix-pull.in nix-push.in nix-profile.sh.in \
   nix-prefetch-url.in nix-install-package.in \
   nix-channel.in \
-  SSH.pm \
   nix-build.in \
   download-using-manifests.pl.in \
   copy-from-other-stores.pl.in \
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in
index e943b0d9e304..e8c76086dae2 100755
--- a/scripts/build-remote.pl.in
+++ b/scripts/build-remote.pl.in
@@ -1,9 +1,9 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w @perlFlags@
 
 use Fcntl ':flock';
 use English '-no_match_vars';
 use IO::Handle;
-use SSH qw/sshOpts openSSHConnection/;
+use Nix::SSH qw/sshOpts openSSHConnection/;
 no warnings('once');
 
 
diff --git a/scripts/nix-copy-closure.in b/scripts/nix-copy-closure.in
index c037f003f0d0..966f860d0b51 100755
--- a/scripts/nix-copy-closure.in
+++ b/scripts/nix-copy-closure.in
@@ -1,8 +1,7 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w @perlFlags@
 
-use SSH;
-
-my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
+use Nix::SSH;
+use Nix::Config;
 
 
 if (scalar @ARGV < 1) {
@@ -61,7 +60,7 @@ if ($toMode) { # Copy TO the remote machine.
     my @allStorePaths;
 
     # Get the closure of this path.
-    my $pid = open(READ, "set -f; $binDir/nix-store --query --requisites @storePaths|") or die;
+    my $pid = open(READ, "set -f; $Nix::Config::binDir/nix-store --query --requisites @storePaths|") or die;
     
     while (<READ>) {
         chomp;
@@ -130,7 +129,7 @@ else { # Copy FROM the remote machine.
         print STDERR "  $_\n" foreach @missing;
         my $extraOpts = "";
         $extraOpts .= "--sign" if $sign == 1;
-        system("set -f; ssh $sshHost @sshOpts 'nix-store --export $extraOpts @missing $compressor' | $decompressor @bindir@/nix-store --import") == 0
+        system("set -f; ssh $sshHost @sshOpts 'nix-store --export $extraOpts @missing $compressor' | $decompressor $Nix::Config::binDir/nix-store --import") == 0
             or die "copying store paths from remote machine `$sshHost' failed: $?";
     }