mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
* Urgh.
This commit is contained in:
parent
eb86b6f5a5
commit
4213b8d8ec
9 changed files with 31 additions and 21 deletions
|
@ -4,6 +4,8 @@ use strict;
|
|||
|
||||
my $profilesDir = "@localstatedir@/nix/profiles";
|
||||
|
||||
my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
|
||||
|
||||
|
||||
# Process the command line arguments.
|
||||
my @args = ();
|
||||
|
@ -34,7 +36,7 @@ sub removeOldGenerations {
|
|||
$name = $dir . "/" . $name;
|
||||
if (-l $name && (readlink($name) =~ /link/)) {
|
||||
print STDERR "removing old generations of profile $name\n";
|
||||
system("@bindir@/nix-env", "-p", $name, "--delete-generations", "old");
|
||||
system("$binDir/nix-env", "-p", $name, "--delete-generations", "old");
|
||||
}
|
||||
elsif (! -l $name && -d $name) {
|
||||
removeOldGenerations $name;
|
||||
|
@ -48,4 +50,4 @@ removeOldGenerations $profilesDir if $removeOld;
|
|||
|
||||
|
||||
# Run the actual garbage collector.
|
||||
exec "@bindir@/nix-store", "--gc", @args;
|
||||
exec "$binDir/nix-store", "--gc", @args;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue