diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-12-15T21·11+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-12-15T21·11+0000 |
commit | 530b27df1e71852580d8b0d474543aeffe65618f (patch) | |
tree | 166f79c170b19ad82ca6bf9a3c77b96325b72aa1 /src/libstore/gc.cc | |
parent | 5144f750c471cdb629750e96ddc913fb01fb9eef (diff) |
* `nix-store --gc' prints out the number of bytes freed on stdout
(even when it is interrupted by a signal).
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index bdaf2946ca58..cb808b6d1b68 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -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. */ |