From 4213b8d8ec8cf478e43b0ec3dc4068e5e55f097a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Nov 2008 15:44:59 +0000 Subject: * Urgh. --- scripts/nix-collect-garbage.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/nix-collect-garbage.in') diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in index b92deefc2436..f445c1c71256 100644 --- a/scripts/nix-collect-garbage.in +++ b/scripts/nix-collect-garbage.in @@ -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; -- cgit 1.4.1