apteryx pushed a commit to branch core-updates-frozen-batched-changes in repository guix.
commit 09416bc894e29cca066a22fb89a84384e926eee1 Author: Maxim Cournoyer <[email protected]> AuthorDate: Tue Oct 26 22:09:46 2021 -0400 nix: libstore: Do not remove unused links when deleting specific items. Deleting unused links can be a very costly operation, especially on rotative hard drives. Removing single store items is often used for experimentation rather than for cleaning purposes, allow it to run without the links cleanup. * nix/libstore/gc.cc (LocalStore::collectGarbage): Do not clean up links when the specified action is GCOptions::gcDeleteSpecific. --- nix/libstore/gc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc index e1d0765..7d872d8 100644 --- a/nix/libstore/gc.cc +++ b/nix/libstore/gc.cc @@ -771,7 +771,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) deleteGarbage(state, state.trashDir); /* Clean up the links directory. */ - if (options.action == GCOptions::gcDeleteDead || options.action == GCOptions::gcDeleteSpecific) { + if (options.action == GCOptions::gcDeleteDead) { printMsg(lvlError, format("deleting unused links...")); removeUnusedLinks(state); }
