about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-04-14T08·09+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-04-14T08·09+0000
commitb275f2ed3b2ae8fc22912122a5a4cdd5ef0fe0cd (patch)
treec484ca50e4dc9266ee2aad3c5bb5162664d2630b /scripts
parenta4d2b22c8ca5064f1da614914c7ea336eedd65c4 (diff)
* `*.gcroot' files can now containing multiple roots.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-collect-garbage.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in
index 20c6731a14b5..fc67f1d55d1b 100755
--- a/scripts/nix-collect-garbage.in
+++ b/scripts/nix-collect-garbage.in
@@ -26,10 +26,14 @@ foreach my $link (@links) {
     $link = $linkdir . "/" . $link;
     next if (!($link =~ /.gcroot$/));
     open ROOT, "<$link" or die "cannot open $link: $!";
-    my $root = <ROOT>;
-    chomp $root;
+    while (<ROOT>) {
+        chomp;
+        foreach my $root (split ' ') {
+            die "bad root `$root' in file `$link'" unless $root =~ /^\S+$/;
+            push @roots, $root;
+        }
+    }
     close ROOT;
-    push @roots, $root;
 }
 
 my $extraarg = "";