From 2754a07eadfa3fe263f83830c701748bbd4c0420 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Dec 2012 18:41:44 +0100 Subject: nix-store -q --roots: Respect the gc-keep-outputs/gc-keep-derivations settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So if a path is not garbage solely because it's reachable from a root due to the gc-keep-outputs or gc-keep-derivations settings, ‘nix-store -q --roots’ now shows that root. --- src/nix-store/nix-store.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nix-store') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index c0da37d251da..af4f264a67e6 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -404,7 +404,8 @@ static void opQuery(Strings opFlags, Strings opArgs) foreach (Strings::iterator, i, opArgs) { PathSet paths = maybeUseOutputs(followLinksToStorePath(*i), useOutput, forceRealise); foreach (PathSet::iterator, j, paths) - computeFSClosure(*store, *j, referrers, true); + computeFSClosure(*store, *j, referrers, true, + settings.gcKeepOutputs, settings.gcKeepDerivations); } Roots roots = store->findRoots(); foreach (Roots::iterator, i, roots) -- cgit 1.4.1