aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-25 19:25:08 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-25 19:25:08 +0000
commit0dc2974930df57cac6673c02e9bc6eb6fd16ba48 (patch)
treec10e6db3dec20bffa8a27b5ce89852bb8f5ea43c /src/nix-store/nix-store.cc
parent8ba089597fa19bfd49ba5f22a5e821740ca4eb5d (diff)
parent1844172dd16cab611a0148be9381ab856bf241df (diff)
Merge remote-tracking branch 'upstream/master' into path-info
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 ad14ba9db..a97a82379 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"
@@ -435,7 +437,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())
@@ -480,13 +482,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;
}
}
@@ -596,7 +600,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);
@@ -635,7 +639,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);