diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-04-14T08·09+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-04-14T08·09+0000 |
commit | b275f2ed3b2ae8fc22912122a5a4cdd5ef0fe0cd (patch) | |
tree | c484ca50e4dc9266ee2aad3c5bb5162664d2630b /scripts/nix-collect-garbage.in | |
parent | a4d2b22c8ca5064f1da614914c7ea336eedd65c4 (diff) |
* `*.gcroot' files can now containing multiple roots.
Diffstat (limited to 'scripts/nix-collect-garbage.in')
-rwxr-xr-x | scripts/nix-collect-garbage.in | 10 |
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 = ""; |