From 00b0fb27c136a0d0c6500efd8c216151e149ce8a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 28 Feb 2022 14:53:07 +0100 Subject: [PATCH] Fix readfile-context.sh --- src/libexpr/primops.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 36eb8fbb6..f50c2dca3 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1460,11 +1460,10 @@ static void prim_readFile(EvalState & state, const Pos & pos, Value * * args, Va auto s = path.readFile(); if (s.find((char) 0) != std::string::npos) throw Error("the contents of the file '%1%' cannot be represented as a Nix string", path); + // FIXME: only do queryPathInfo if path.accessor is the store accessor auto refs = - #if 0 - state.store->isInStore(path) ? - state.store->queryPathInfo(state.store->toStorePath(path).first)->references : - #endif + state.store->isInStore(path.path) ? + state.store->queryPathInfo(state.store->toStorePath(path.path).first)->references : StorePathSet{}; auto context = state.store->printStorePathSet(refs); v.mkString(s, context);