diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-09-01T20·21+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-09-01T21·53+0200 |
commit | 8fb8c26b6d07d2aadf9cf85bda159c815996be89 (patch) | |
tree | c7aa813a7279895ddc2609cf26ab3faf36043f3a /src/nix-store/nix-store.cc | |
parent | 27a01d92c2be3e6c1be23f96d24c3d3358489a87 (diff) |
Add an 'optimiseStore' remote procedure call.
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r-- | src/nix-store/nix-store.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 8c3744824ce6..51839fac11ee 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -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()) |