mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
nix-store --gc: Make ‘--max-freed 0’ do the right thing
That is, delete almost nothing (it will still remove unused links from /nix/store/.links).
This commit is contained in:
parent
1df702d347
commit
967d066d8e
4 changed files with 6 additions and 7 deletions
|
@ -550,7 +550,7 @@ bool LocalStore::tryToDelete(GCState & state, const Path & path)
|
|||
} else
|
||||
deleteGarbage(state, path);
|
||||
|
||||
if (state.options.maxFreed && state.results.bytesFreed + state.bytesInvalidated > state.options.maxFreed) {
|
||||
if (state.results.bytesFreed + state.bytesInvalidated > state.options.maxFreed) {
|
||||
printMsg(lvlInfo, format("deleted or invalidated more than %1% bytes; stopping") % state.options.maxFreed);
|
||||
throw GCLimitReached();
|
||||
}
|
||||
|
@ -675,7 +675,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
|
|||
throw Error(format("cannot delete path `%1%' since it is still alive") % *i);
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (options.maxFreed > 0) {
|
||||
|
||||
if (shouldDelete(state.options.action))
|
||||
printMsg(lvlError, format("deleting garbage..."));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue