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:
parent
92f7dfa5b7
commit
4250b641d8
2 changed files with 19 additions and 5 deletions
|
@ -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__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue