diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-25T11·43+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-25T11·43+0000 |
commit | 818047881e4906c670104851f69c3179ecc7fb1f (patch) | |
tree | a89d6e93403065aca4cfaefdaef2706e04ebf962 /src/libstore/gc.hh | |
parent | 9994c1dd9fe19a3bb8f7bbddbcd5622c9c30d85b (diff) |
* Put the garbage collector in nix-store: operation `--gc',
suboperations `--print-live', `--print-dead', and `--delete'. The roots are not determined by nix-store; they are read from standard input. This is to make it easy to customise what the roots are. The collector now no longer fails when store expressions are missing (which legally happens when using substitutes). It never tries to fetch paths through substitutes. TODO: acquire a global lock on the store while garbage collecting. * Removed `nix-store --delete'.
Diffstat (limited to 'src/libstore/gc.hh')
-rw-r--r-- | src/libstore/gc.hh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libstore/gc.hh b/src/libstore/gc.hh new file mode 100644 index 000000000000..997057ba9b7b --- /dev/null +++ b/src/libstore/gc.hh @@ -0,0 +1,24 @@ +#ifndef __GC_H +#define __GC_H + +#include "storeexpr.hh" + + +/* Determine the set of "live" store paths, given a set of root store + expressions. The live store paths are those that are reachable + from the roots. The roots are reachable by definition. Any path + mentioned in a reachable store expression is also reachable. If a + derivation store expression is reachable, then its successor (if it + exists) if also reachable. It is not an error for store + expressions not to exist (since this can happen on derivation store + expressions, for instance, due to the substitute mechanism), but + successor links are followed even for non-existant derivations. */ +PathSet findLivePaths(const Paths & roots); + +/* Given a set of "live" store paths, determine the set of "dead" + store paths (which are simply all store paths that are not in the + live set). */ +PathSet findDeadPaths(const PathSet & live); + + +#endif /* !__GC_H */ |