From 74f75c855837bce7f48491e9ce8ac03794e5b40d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 12 Jan 2018 17:31:08 +0100 Subject: import, builtins.readFile: Handle diverted stores Fixes #1791 --- src/libstore/store-api.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libstore/store-api.hh') diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index d1e1b5d6f452..c0e735cd314c 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -597,6 +597,11 @@ public: "nix-cache-info" file. Lower value means higher priority. */ virtual int getPriority() { return 0; } + virtual Path toRealPath(const Path & storePath) + { + return storePath; + } + protected: Stats stats; @@ -639,9 +644,10 @@ public: virtual Path getRealStoreDir() { return storeDir; } - Path toRealPath(const Path & storePath) + Path toRealPath(const Path & storePath) override { - return getRealStoreDir() + "/" + baseNameOf(storePath); + assert(isInStore(storePath)); + return getRealStoreDir() + "/" + std::string(storePath, storeDir.size() + 1); } std::shared_ptr getBuildLog(const Path & path) override; -- cgit 1.4.1