aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 8ebaf9387..153b84137 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -3,7 +3,9 @@
#include "dotgraph.hh"
#include "globals.hh"
#include "build-result.hh"
+#include "store-cast.hh"
#include "gc-store.hh"
+#include "log-store.hh"
#include "local-store.hh"
#include "monitor-fd.hh"
#include "serve-protocol.hh"
@@ -429,7 +431,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
store->computeFSClosure(
args, referrers, true, settings.gcKeepOutputs, settings.gcKeepDerivations);
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = require<GcStore>(*store);
Roots roots = gcStore.findRoots(false);
for (auto & [target, links] : roots)
if (referrers.find(target) != referrers.end())
@@ -474,13 +476,15 @@ static void opReadLog(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
+ auto & logStore = require<LogStore>(*store);
+
RunPager pager;
for (auto & i : opArgs) {
- auto path = store->followLinksToStorePath(i);
- auto log = store->getBuildLog(path);
+ auto path = logStore.followLinksToStorePath(i);
+ auto log = logStore.getBuildLog(path);
if (!log)
- throw Error("build log of derivation '%s' is not available", store->printStorePath(path));
+ throw Error("build log of derivation '%s' is not available", logStore.printStorePath(path));
std::cout << *log;
}
}
@@ -590,7 +594,7 @@ static void opGC(Strings opFlags, Strings opArgs)
if (!opArgs.empty()) throw UsageError("no arguments expected");
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = require<GcStore>(*store);
if (printRoots) {
Roots roots = gcStore.findRoots(false);
@@ -629,7 +633,7 @@ static void opDelete(Strings opFlags, Strings opArgs)
for (auto & i : opArgs)
options.pathsToDelete.insert(store->followLinksToStorePath(i));
- auto & gcStore = requireGcStore(*store);
+ auto & gcStore = require<GcStore>(*store);
GCResults results;
PrintFreed freed(true, results);