1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

* `nix-store --gc --print-dead': print the total size of the store

objects that would be freed.
This commit is contained in:
Eelco Dolstra 2006-08-11 20:26:49 +00:00
parent 92f7dfa5b7
commit 4250b641d8
2 changed files with 19 additions and 5 deletions

View file

@ -515,6 +515,15 @@ void collectGarbage(GCAction action, const PathSet & pathsToDelete,
debug(format("dead path `%1%'") % *i);
result.insert(*i);
/* If just returning the set of dead paths, we also return the
space that would be freed if we deleted them. */
if (action == gcReturnDead) {
struct stat st;
if (lstat(i->c_str(), &st) == -1)
st.st_size = 0;
bytesFreed += st.st_size;
}
if (action == gcDeleteDead || action == gcDeleteSpecific) {
#ifndef __CYGWIN__