mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Add an 'optimiseStore' remote procedure call.
This commit is contained in:
parent
27a01d92c2
commit
8fb8c26b6d
8 changed files with 42 additions and 20 deletions
|
@ -823,16 +823,6 @@ static void opRepairPath(Strings opFlags, Strings opArgs)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void showOptimiseStats(OptimiseStats & stats)
|
||||
{
|
||||
printMsg(lvlError,
|
||||
format("%1% freed by hard-linking %2% files")
|
||||
% showBytes(stats.bytesFreed)
|
||||
% stats.filesLinked);
|
||||
}
|
||||
|
||||
|
||||
/* Optimise the disk space usage of the Nix store by hard-linking
|
||||
files with the same contents. */
|
||||
static void opOptimise(Strings opFlags, Strings opArgs)
|
||||
|
@ -840,17 +830,9 @@ static void opOptimise(Strings opFlags, Strings opArgs)
|
|||
if (!opArgs.empty() || !opFlags.empty())
|
||||
throw UsageError("no arguments expected");
|
||||
|
||||
OptimiseStats stats;
|
||||
try {
|
||||
ensureLocalStore().optimiseStore(stats);
|
||||
} catch (...) {
|
||||
showOptimiseStats(stats);
|
||||
throw;
|
||||
}
|
||||
showOptimiseStats(stats);
|
||||
store->optimiseStore();
|
||||
}
|
||||
|
||||
|
||||
static void opQueryFailedPaths(Strings opFlags, Strings opArgs)
|
||||
{
|
||||
if (!opArgs.empty() || !opFlags.empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue