From da1e4fdfb54e0a69dd145180cae1eb7a0afd1b26 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 14 Sep 2017 14:38:36 +0200 Subject: nix-store -q --roots / --gc --print-roots: Print temporary / in-memory roots For example, $ nix-store -q --roots /nix/store/7phd2sav7068nivgvmj2vpm3v47fd27l-patchelf-0.8pre845_0315148 {temp:1} denotes that the path is only being kept alive by a temporary root (i.e. /nix/var/nix/temproots/). Similarly, $ nix-store --gc --print-roots ... {memory:9} -> /nix/store/094gpjn9f15ip17wzxhma4r51nvsj17p-curl-7.53.1 shows that curl is being used by some process. --- src/libstore/local-store.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 4973bd9a9849..62a11a94a5e4 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -176,7 +176,7 @@ private: typedef std::shared_ptr FDPtr; typedef list FDs; - void readTempRoots(PathSet & tempRoots, FDs & fds); + PathSet readTempRoots(FDs & fds); public: @@ -261,7 +261,9 @@ private: void findRoots(const Path & path, unsigned char type, Roots & roots); - void findRuntimeRoots(PathSet & roots); + Roots findRootsNoTemp(); + + PathSet findRuntimeRoots(); void removeUnusedLinks(const GCState & state); -- cgit 1.4.1