about summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
authorMartin Bravenboer <martin.bravenboer@logicblox.com>2003-12-04T14·38+0000
committerMartin Bravenboer <martin.bravenboer@logicblox.com>2003-12-04T14·38+0000
commitfeaab52203a51a4abec23f5d878f6f4dea29dcd5 (patch)
tree97e84157784f7d268481507116e92f9573d9a0ae /scripts/nix-pull.in
parent00d4f907e1b9bfab0c51a4459d5f0e6a105fc1d7 (diff)
* Fix for too long command lines when calling `nix-store
  --register-[substitutes|successors].

Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in20
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index f1fb57e9b2..86004102d9 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -139,11 +139,23 @@ $? == 0 or die "nix-instantiate failed";
 
 # Register all substitutes.
 print STDERR "registering substitutes...\n";
-system "nix-store --substitute @subs";
-if ($?) { die "`nix-store --substitute' failed"; }
+while (scalar @subs > 0) {
+    my $n = scalar @subs;
+    if ($n > 256) { $n = 256 };
+    my @subs2 = @subs[0..$n - 1];
+    @subs = @subs[$n..scalar @subs - 1];
+    system "nix-store --substitute @subs2";
+    if ($?) { die "`nix-store --substitute' failed"; }
+}
 
 
 # Register all successors.
 print STDERR "registering successors...\n";
-system "nix-store --successor @sucs";
-if ($?) { die "`nix-store --successor' failed"; }
+while (scalar @sucs > 0) {
+    my $n = scalar @sucs;
+    if ($n > 256) { $n = 256 };
+    my @sucs2 = @sucs[0..$n - 1];
+    @sucs = @sucs[$n..scalar @sucs - 1];
+    system "nix-store --successor @sucs";
+    if ($?) { die "`nix-store --successor' failed"; }
+}