about summary refs log tree commit diff
path: root/scripts/copy-from-other-stores.pl.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/copy-from-other-stores.pl.in')
-rwxr-xr-xscripts/copy-from-other-stores.pl.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/copy-from-other-stores.pl.in b/scripts/copy-from-other-stores.pl.in
index 3ee6f075b27e..9ed7e4cc22c0 100755
--- a/scripts/copy-from-other-stores.pl.in
+++ b/scripts/copy-from-other-stores.pl.in
@@ -83,12 +83,13 @@ if ($ARGV[0] eq "--query") {
 
 
 elsif ($ARGV[0] eq "--substitute") {
-    die unless scalar @ARGV == 2;
+    die unless scalar @ARGV == 3;
     my $storePath = $ARGV[1];
+    my $destPath = $ARGV[2];
     my ($store, $sourcePath) = findStorePath $storePath;
     die unless $store;
     print STDERR "\n*** Copying `$storePath' from `$sourcePath'\n\n";
-    system("$binDir/nix-store --dump $sourcePath | $binDir/nix-store --restore $storePath") == 0
+    system("$binDir/nix-store --dump $sourcePath | $binDir/nix-store --restore $destPath") == 0
         or die "cannot copy `$sourcePath' to `$storePath'";
     print "\n"; # no hash to verify
 }