mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
find-runtime-roots.pl: Search process environments for roots
For instance, this prevents paths from being deleted that are in use by a "nix-build --run-env" session.
This commit is contained in:
parent
938092a213
commit
00f698eb8b
1 changed files with 7 additions and 0 deletions
|
@ -35,6 +35,13 @@ sub readProc {
|
|||
}
|
||||
close MAP;
|
||||
}
|
||||
|
||||
# Get all store paths that appear in the environment of this process.
|
||||
eval {
|
||||
my $env = Nix::Utils::readFile "$process/environ";
|
||||
my @matches = $env =~ /\/nix\/store\/[0-9a-z]+[0-9a-zA-Z\+\-\._\?=]*/g;
|
||||
print "$_\n" foreach @matches;
|
||||
}
|
||||
}
|
||||
|
||||
closedir DIR;
|
||||
|
|
Loading…
Reference in a new issue