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

* `nix-store --gc' prints out the number of bytes freed on stdout

(even when it is interrupted by a signal).
This commit is contained in:
Eelco Dolstra 2005-12-15 21:11:39 +00:00
parent 5144f750c4
commit 530b27df1e
7 changed files with 45 additions and 11 deletions

View file

@ -303,9 +303,11 @@ static Paths topoSort(const PathSet & paths)
}
void collectGarbage(GCAction action, PathSet & result)
void collectGarbage(GCAction action, PathSet & result,
unsigned long long & bytesFreed)
{
result.clear();
bytesFreed = 0;
bool gcKeepOutputs =
queryBoolSetting("gc-keep-outputs", false);
@ -452,7 +454,9 @@ void collectGarbage(GCAction action, PathSet & result)
printMsg(lvlInfo, format("deleting `%1%'") % *i);
/* Okay, it's safe to delete. */
deleteFromStore(*i);
unsigned long long freed;
deleteFromStore(*i, freed);
bytesFreed += freed;
if (fdLock != -1)
/* Write token to stale (deleted) lock file. */